ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checke code example
Example 1: angular ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
constructor(private ref: ChangeDetectorRef){}
ngAfterContentChecked() {
this.ref.detectChanges();
}
Example 2: expression changed after it has been checked
export class BComponent {
@Input() text;
constructor(private parent: AppComponent) {}
ngOnInit() {
this.parent.text = 'updated text';
}
}<>Copy