Please explain to me why I keep getting this error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
Obviously,
I hope this helps someone coming here:
We make service calls in ngOnInit
in the following manner and use a variable displayMain
to control the Mounting of the elements to the DOM.
component.ts
displayMain: boolean;
ngOnInit() {
this.displayMain = false;
// Service Calls go here
// Service Call 1
// Service Call 2
// ...
this.displayMain = true;
}
and component.html