Skip to content

Instantly share code, notes, and snippets.

@chidumennamdi
Created August 22, 2018 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chidumennamdi/efcfcba7a2c23774761b9ab37cbd11ce to your computer and use it in GitHub Desktop.
Save chidumennamdi/efcfcba7a2c23774761b9ab37cbd11ce to your computer and use it in GitHub Desktop.
@Component({
selector: 'my-i',
template:`
{{count}}
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class IComponent{
count = 0
constructor(private cd: ChangeDetectorRef) {
setTimeout(()=>{
this.count++;
this.cd.markForCheck()
},1000)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment