Answers for "angular ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked."

7

angular ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.

constructor(private ref: ChangeDetectorRef){}

  ngAfterContentChecked() {
    this.ref.detectChanges();
  }
Posted by: Guest on October-29-2020
0

expression changed after it has been checked

export class BComponent {
    @Input() text;

    constructor(private parent: AppComponent) {}

    ngOnInit() {
        this.parent.text = 'updated text';
    }
}<>Copy
Posted by: Guest on February-22-2021

Code answers related to "angular ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked."

Code answers related to "Javascript"

Browse Popular Code Answers by Language