Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to set value to readonly property in typescript

beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [
        MyService
      ]
    });
    service = TestBed.get(MyService);
    const timeIntervals = 'timeIntervals';
    Object.defineProperty(service, timeIntervals, { value: timeLists });
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #readonly #property #typescript
ADD COMMENT
Topic
Name
8+8 =