how to set value to readonly property in typescript how to set value to readonly property in typescript

The solution for “how to set value to readonly property in typescript how to set value to readonly property in typescript” can be found here. The following code will assist you in solving the problem.

Object.defineProperty(service, timeIntervals, { writable: true});beforeEach(() => {
TestBed.configureTestingModule({
providers: [
MyService
]
});
service = TestBed.get(MyService);
const timeIntervals = ‘timeIntervals’;
Object.defineProperty(service, timeIntervals, { value: timeLists });
});

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in