Tostr messages not working. Script error in browser console.
See original GitHub issueHi,
I followed the instructions to setup toastr as per the readme. Am using Angular version 4.1.3. ngx-toastr version is 5.2.4
this.toastrService.success(‘Hello world!’, ‘Toastr fun!’);
The above line is throwing the following exception in browser console:
dom-portal-host.js:45 Uncaught TypeError: Cannot read property 'attachView' of undefined at DomPortalHost.attachComponentPortal (dom-portal-host.js:45) at DomPortalHost.BasePortalHost.attach (portal.js:47) at OverlayRef.attach (overlay-ref.js:10) at ToastrService._buildNotification (toastr-service.js:152) at ToastrService.success (toastr-service.js:25)
Any help is greatly appreciated.
Thanks, Hari
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Toastr notification not appearing when called - Stack Overflow
I tried the following code but nothing's popping up when I launch the page in my browser $(function ...
Read more >Error.prototype.toString() - JavaScript - MDN Web Docs - Mozilla
The toString() method returns a string representing the specified Error object. ... error"); e4.name = ""; e4.message = undefined; console.log(e4.
Read more >JavaScript console.error() Method - W3Schools
The error() method writes an error message to the console. The console is useful for testing purposes. Syntax. console.error(message). Parameters ...
Read more >toast options not working - Material Design for Bootstrap
p>Hi I am trying to use TOAST message to display error message. ... <script> Command: toastr["error"]("Incorrect Username or Password!
Read more >Click() method not working and Console returns an error ...
getElementsByClassName(…).click is not a function” error created while using click() method in JavaScript. The TypeError is an object that ...
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’ve implemented something like this before. Here is what I’ve done:
app.error-handler.ts:
And then in app.module.ts:
This is very similar to what you’re doing. I’m not sure if NgZone is needed or not, it was working for HTTP error without it, but I decided to add it anyways, just in case.
@yarrgh wow… thank you so much, i was losing hope.