Cannot add property “X”, object is not extensible angular 9

前端 未结 2 1659
野趣味
野趣味 2021-01-20 20:46

I have encountered this issue on many places after some days of updating from Angular 8 to Angular 9. Earlier it was working fine.

Can anyone help me what\'s the pro

2条回答
  •  生来不讨喜
    2021-01-20 21:35

    If you are getting this error after using NgRx in Angular. Try implementing below code it will help on a global level. Otherwise you can utilize deep cloning of Object or Array to eradicate the problem.

    @NgModule({
      imports: [
      StoreModule.forRoot(reducers, {
        runtimeChecks: {
          strictStateImmutability: false,
          strictActionImmutability: false,
        },
      }),
     ],
    })
    export class AppModule {}
    

提交回复
热议问题