changeDetection Not checking for update when i use rxjs interval with ApplicationRef.isStable
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/coreIs this a regression?
Donβt know whether it is worked in previous or not
Description
A clear and concise description of the problem...If i want to use interval in my application i have to start interval after app isStable. But it makes application not to check for changes
π¬ Minimal Reproduction
https://stackblitz.com/edit/angular-if8xoz
In above link app.component.ts - ngOnInit
hook my interval is running and console log give the correct value but the ui is not updating. This occurs only when i use ApplicationRef.isStable
π₯ Exception or Error
π Your Environment
Angular Version:
Angular CLI: 7.0.7
Node: 10.10.0
OS: win32 x64
Angular: 7.1.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.7
@angular-devkit/build-angular 0.10.7
@angular-devkit/build-optimizer 0.10.7
@angular-devkit/build-webpack 0.10.7
@angular-devkit/core 7.0.7
@angular-devkit/schematics 7.0.7
@angular/cli 7.0.7
@angular/fire 5.1.1
@angular/pwa 0.10.7
@ngtools/webpack 7.0.7
@schematics/angular 7.0.7
@schematics/update 0.10.7
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
Anything else relevant?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
ApplicationRef - Angular
Returns an Observable that indicates when the application is stable or unstable. ... using RxJS interval ), and at the same time subscribe...
Read more >How can I use 'interval' Rxjs function without executing ...
when you want to update the value you can Inject ChangeDetectorRef in the constructor and call the method this.changeDetectorRef.markForCheck();Β ...
Read more >Boosting performance of Angular applications with manual ...
Angular uses NgZone/Zone.js to know when to trigger UI update (change detection) when our app data state changes. It brilliantly utilized the events...
Read more >The Last Guide For Angular Change Detection You'll Ever Need
Developer updates the data model, e.g. by updating a component binding; Angular detects the change; Change detection checks every component in the componentΒ ......
Read more >angular/core/core.d.ts - UNPKG
318, * (here incrementing a counter, using RxJS `interval`), ... 368, * You'll have to manually trigger the change detection to update the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gkalpak, thanks for the update, and I believe
isStable
isoutsideOf ngZone
to avoid endless loop. SoisStable next -> ngZone.run -> isStable next ...
.I might do something like below (but I am neither a Zone.js nor an RxJS expert π):