Error when opening modal in ngOnChanges
See original GitHub issueBug description:
Attempting to open a modal as the result of a change via ngOnChanges
results in an:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'modal fade show'. 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 ?
Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/svQOUKKRvyWlioopFTjy?p=preview
Version of Angular, ng-bootstrap, and Bootstrap:
- Angular:
angular@4.0.3
- ng-bootstrap:
ng-bootstrap@1.0.0-alpha.26
- Bootstrap:
bootstrap@4.0.0-alpha.6
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
typescript - Angular - Modal NgBootstrap ... - Stack Overflow
I used modal of ng-bootstrap, i tried to open the modal when a data send from first component to sencons component in the...
Read more >NG0100: Expression has changed after it was checked - Angular
This error commonly occurs when you've added template expressions or have begun to implement lifecycle hooks like ngAfterViewInit or ngOnChanges .
Read more >ngOnChanges only runs when the Input change comes from a ...
ngOnChanges only runs when the Input change comes from a template binding like <component [someInput]="aValue"> .
Read more >Player Modal Ngonchanges - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >Angular Debugging "Expression has changed": Explanation ...
This type of error usually shows up beyond the initial development stages, when we start to have some more expressions in our templates,...
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
I found a workaround in my case, where i have a login form then pressing key enter i open a NgbModal.
I did the following:
Solved 😃
Tried all the other ways like setTimeout and no success
This is Angular’s limitation, see: https://github.com/angular/angular/issues/15634
More details in https://github.com/ng-bootstrap/ng-bootstrap/issues/1384
Closing as a duplicate of https://github.com/angular/angular/issues/15634