@@ -6,7 +6,7 @@ largely based off of [AngularJS-Toaster](https://github.com/jirikavi/AngularJS-T
6
6
[ ![ npm] ( https://img.shields.io/npm/v/angular2-toaster.svg?maxAge=3600?caching=true )] ( https://www.npmjs.com/package/angular2-toaster )
7
7
[ ![ npm] ( https://img.shields.io/npm/dt/angular2-toaster.svg?caching=true )] ( https://www.npmjs.com/package/angular2-toaster )
8
8
[ ![ Build Status] ( https://travis-ci.org/Stabzs/Angular2-Toaster.svg?branch=master )] ( https://travis-ci.org/Stabzs/Angular2-Toaster )
9
- [ ![ Coverage Status] ( https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=6.0 .0 )] ( https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master )
9
+ [ ![ Coverage Status] ( https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=6.1 .0 )] ( https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master )
10
10
11
11
12
12
Version ^5.0.0 requires either ` .forRoot() ` or ` .forChild() ` ` ToasterModule ` inclusion. Please
@@ -560,6 +560,32 @@ Run Karma test instance with coverage report:
560
560
npm run test
561
561
` ` `
562
562
563
+ # Frequently Asked Questions and Issues
564
+ ## I get the ` No Toaster Containers have been initialized to receive toasts.` error
565
+
566
+ You have not properly initialized a toaster container instance before trying to publish a toast.
567
+ Make sure that you have rendered the ` toaster- container` component and that you are importing
568
+ the ` ToasterModule` with ` ToasterModule .forRoot ()` .
569
+
570
+ ## Toasts are not displayed when popped from an error handler
571
+ The ` handleError` function is executed outsize of an Angular zone. You need to
572
+ explicitly tell Angular to run the pop call within the context of a zone.
573
+
574
+ ` ` ` TypeScript
575
+ export class AppErrorHandler implements ErrorHandler {
576
+ constructor (
577
+ private toasterService : ToasterService ,
578
+ private ngZone : NgZone ) { }
579
+
580
+ handleError (error: any): void {
581
+ this .ngZone .run (() => {
582
+ this .toasterService .pop (' error' , " Error" , error);
583
+ });
584
+ }
585
+ }
586
+ ` ` `
587
+ (See this great [Stack Overflow Answer]( https://stackoverflow.com/questions/44975477/angular2-ng-toasty-errorhandler) for more details).
588
+
563
589
564
590
## Author
565
591
@@ -570,7 +596,7 @@ Rewritten from https://github.com/jirikavi/AngularJS-Toaster
570
596
Inspired by http://codeseven.github.io/toastr/demo.html.
571
597
572
598
## Copyright
573
- Copyright © 2016-2017 Stabzs.
599
+ Copyright © 2016-2018 Stabzs.
574
600
575
601
576
602
## Licence
0 commit comments