I hope this will help you out. I don't like using links cause it may broke in the future. So here is what you need to know about this type of error.
A running Angular application is a tree of components. During change detection Angular performs checks for each component which consists of the following operations performed in the specified order:
- update bound properties for all child components/directives
- call ngOnInit, OnChanges and ngDoCheck lifecycle hooks on all child
components/directives
- update DOM for the current component
- run change detection for a child component
- call ngAfterViewInit lifecycle hook for all child
components/directives
There are other operations that are performed during change detection.
After each operation Angular remembers what values it used to perform an operation. They are stored in the oldValues property of the component view. After the checks have been done for all components Angular then starts the next digest cycle but instead of performing the operations listed above it compares the current values with the ones it remembers from the previous digest cycle:
- check that values passed down to the child components are the same as
the values that would be used to update properties of these
components now
- check that values used to update the DOM elements are the same as the
values that would be used to update these elements now
- perform the same checks for all child components
Please note that this additional check is only performed in the development mode.
2nd question: It seems that recently almost every day there’s a question on stackoverflow regarding the ExpressionChangedAfterItHasBeenCheckedError error thrown by Angular. Usually these questions come up because Angular developers do not understand how change detection works and why the check that produces this error is required. Many developers even view it as a bug. But it’s certainly not.
U can find a good example here at the title: Causes of values change.
https://blog.angularindepth.com/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error-e3fd9ce7dbb4