Blog Post

Generic error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'isLoading: [object Object]'. Current value: 'isLoading: true'

,

Error: Generic error:  ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'isLoading: [object Object]'. Current value: 'isLoading: true'

Resolution:

setTimeout the code that is setting the value. In my case, it was ngRX store dispatch action so I have changed action like below.

It was like below =>

public setProgress(isLoading: boolean) {
this.store.dispatch(new SetLaoding(isLoading));
}

I changed it to =>

public setProgress(isLoading: boolean) {
setTimeout(() => {
this.store.dispatch(new SetLaoding(isLoading));
});
}

and then this error resolved.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating