You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property 'componentRef' of null
Expected Result:
componentInstance is undefined
The demo demonstrates a simplified version of the problem.
I think this could be useful when you have a NgbModalRef in something like ngOnChanges and you are trying to determine if the modal is open to change its Inputs.
Bug description:
Accessing
componentInstance
after a modal was closed raises a javascript error.Link to minimally-working StackBlitz that reproduces the issue:
demo
Steps to reproduce in the sample.
Launch demo modal
Raise componentInstance error
Result:
TypeError: Cannot read property 'componentRef' of null
Expected Result:
componentInstance
isundefined
The demo demonstrates a simplified version of the problem.
I think this could be useful when you have a
NgbModalRef
in something likengOnChanges
and you are trying to determine if the modal is open to change itsInputs
.It would allow you to do things like
which overall would provide more flexibility.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 8.0.0
ng-bootstrap: 5.1.1
Bootstrap: 4.3.1
The text was updated successfully, but these errors were encountered: