ng2-slim-loading-bar
ng2-slim-loading-bar copied to clipboard
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '0%'. Current value: '15%'.
I'm submitting a ... (check one with "x")
[X ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Current behavior
Loading bar is triggered and everything is pretty nice, except the fact I'm getting this exception in the console:
SlimLoadingBarComponent.html:3 ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '0%'. Current value: '15%'. at viewDebugError (core.es5.js:8633) at expressionChangedAfterItHasBeenCheckedError (core.es5.js:8611) at checkBindingNoChanges (core.es5.js:8775) at checkNoChangesNodeInline (core.es5.js:12329) at checkNoChangesNode (core.es5.js:12303) at debugCheckNoChangesNode (core.es5.js:12922) at debugCheckRenderNodeFn (core.es5.js:12862) at Object.eval [as updateRenderer] (SlimLoadingBarComponent.html:3) at Object.debugUpdateRenderer [as updateRenderer] (core.es5.js:12844) at checkNoChangesView (core.es5.js:12125) at callViewAction (core.es5.js:12487)
It happens only in one case in my app, sadly I can't even try reproduce it, as it's huge private logic...
Expected/desired behavior No exceptions when triggering loadig-bar at all times.
Reproduction of the problem
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Please tell us about your environment: angular-cli setup
-
ng2-slim-loading-bar version: 4.0.0
-
Angular version: 4.*
-
Browser: ALL
-
Language: TS
Hi @SlimDogs ,
Can you share a bit more information about your environment like webpack/systemjs, code snippets etc?
Hey, well it's too complex. It wasn't the issue with the plugin itself - it's issue with the architecture... To resolve this I recommend to use setTimeout(() => { ng-slim-loading-bar update logic goes here });
@SlimDogs Your advise seems not working for me, i get the error again.I try to close the slim-bar after child component created.So i face the same error.
I'm also facing the same problem... Yes, if I add setTimeout() it fixes the issue but that shouldn't be the best solution. :(