Last active
June 1, 2020 12:58
-
-
Save AregSargsyan/bf5aa510cc92d30be2b2ad01240804a7 to your computer and use it in GitHub Desktop.
these event will not trigger change detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
template: `...`, | |
changeDetection: ChangeDetectionStrategy.OnPush | |
}) | |
export class CounterComponent { | |
count = 0; | |
constructor() { | |
setTimeout(() => this.count ++, 0); | |
setInterval(() => this.count ++, 100); | |
Promise.resolve().then(() => this.count = 10); | |
this.http.get('https://count.com').subscribe(res => { | |
this.count = res; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment