I use ng2-toastr on my page and work fine, but when I have a nested component on the page, the existing ng2-toastr (ToastManager) area is destroyed, and toastr does not work.
constructor(public toastr: ToastsManager,public vcr: ViewContainerRef) { this.toastr.setRootViewContainerRef(vcr); }
In my method, when I call
this.toastr.warning('Its Warning','Alert');
Works fine, but in my html when I load another component ie
<es-app></es-app>
toastr on my page does not work (no errors)
Sometimes I get:
Attempted to use a corrupted view: detectChanges Error: Attempted to use a corrupted view: detectChanges at ViewDestroyedError
source share