angular4-notify
Installation
To install this library, run:
$ npm install angular4-notify --save
How to use
Import notifications module and service:
;
Once your library is imported, you can use its service in your Angular application:
<!-- You can now use your library component in app.component.html -->
Adding notifications
To add notifications to be rendered firstly inject NotificationsService into your component:
; constructorprotected notificationsService: NotificationsService
and then use following methods:
this.notificationsService.addError'Error message here';this.notificationsService.addWarning'Some warning message';this.notificationsService.addInfo'Information message';
Changelist
1.2.0 resetting notifications array while navigating with router.
1.1.0 Prevent from similar messages doubling.
1.0.1 First stable version
License
MIT © alexander.poltoratskiy