ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'

后端 未结 10 1586
Happy的楠姐
Happy的楠姐 2020-12-07 18:27

I know there are a lot of same questions already posted in stack-overflow and tried different solutions to avoid the run-time error but None of them are working for me.

10条回答
  •  春和景丽
    2020-12-07 18:45

    Try this, to call your code in ngOnInit()

    someMethod() // emitted method call from output
    {
        // Your code 
    }
    
    ngOnInit(){
      someMethod(); // call here your error will be gone
    }
    

提交回复
热议问题