Skip to content

Instantly share code, notes, and snippets.

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