Skip to content

Instantly share code, notes, and snippets.

@AregSargsyan
Created June 6, 2020 14:44
Show Gist options
  • Save AregSargsyan/522aacc444a0fd5b9a3b03491eb074d3 to your computer and use it in GitHub Desktop.
Save AregSargsyan/522aacc444a0fd5b9a3b03491eb074d3 to your computer and use it in GitHub Desktop.
ExpressionChangedAfterItHasBeenCheckedError
import { Component } from '@angular/core';
@Component({
selector: 'app-child',
template: `<span>{{count}}</span>`,
})
export class ChildComponent {
count = 0;
constructor() { }
increaseCount() {
this.count += 1;
}
ngAfterViewInit() {
this.increaseCount()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment