ExpressionChangedAfterItHasBeenCheckedError in Dynamic component loader sample
See original GitHub issueWhich @angular/* package(s) are the source of the bug?
core
Is this a regression?
Unknown
Description
I was trying to implement something similar to the sample here: https://angular.io/guide/dynamic-component-loader And keept running into a ExpressionChangedAfterItHasBeenCheckedError and could not figure out what I did wrong.
I finally realized that the Sample it self throws this very same error.
Not sure if this is classified as a Documentation defect or an Angular defect, I am guessing the former but not sure. Is there a way to get around this error?
Please provide a link to a minimal reproduction of the bug
https://angular.io/generated/live-examples/dynamic-component-loader/stackblitz.html
Please provide the exception or error you saw
vendor.js:20510 ERROR Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Bombasto'. It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook?. Find more at https://angular.io/errors/NG0100
at throwErrorIfNoChangesMode (vendor.js:20758:11)
at bindingUpdated (vendor.js:26744:17)
at interpolation1 (vendor.js:26851:23)
at ɵɵtextInterpolate1 (vendor.js:31194:26)
at Module.ɵɵtextInterpolate (vendor.js:31170:5)
at HeroProfileComponent_Template (main.js:288:72)
at executeTemplate (vendor.js:23642:9)
at refreshView (vendor.js:23508:13)
at refreshComponent (vendor.js:24679:13)
at refreshChildComponents (vendor.js:23304:9)
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 13.1.4
Node: 14.16.0
Package Manager: npm 7.17.0
OS: linux x64
Angular: 13.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1301.4
@angular-devkit/build-angular 13.1.4
@angular-devkit/core 13.1.4
@angular-devkit/schematics 13.1.4
@angular/cli 13.1.4
@schematics/angular 13.1.4
rxjs 7.4.0
typescript 4.5.5
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Angular dynamic component loading - Stack Overflow
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current ...
Read more >Getting an "ExpressionChangedAfterItHasBeenCheckedError ...
Getting an "ExpressionChangedAfterItHasBeenCheckedError" error after dynamic component loading with in angular app which uses routing.
Read more >NG0100: Expression has changed after it was checked - Angular
Angular throws an ExpressionChangedAfterItHasBeenCheckedError when an expression value has been changed after change detection has completed. Angular only ...
Read more >Everything you need to know about the ... - InDepth.Dev
Everything you need to know about the `ExpressionChangedAfterItHasBeenCheckedError` error. This article explains the underlying causes of the error and the ...
Read more >The great angular dynamic (components) edit page
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngForOf: undefined'. Current ...
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 FreeTop 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
Top GitHub Comments
@AndrewKushnir Hi ! I can fix this error in 3 different ways which would you prefer me to do ?
I prefer the first
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.