ng6-notify-popup
for Angular 6.x.
Based on
- ng2-notify-popup for Angular 4.x by Shubhangi Gupta
- ng-notify for Angular 1.x by Mat Owens
View Demo - still Angular 4 version
Installation
$ npm install --save ng6-notify-popup
Usage
AppModule
:
;; ; /** IMPORTANT : IE10 and IE11 requires the following to support `@angular/animation` (which is used by this module).Run `npm install --save web-animations-js`.*/; // Import library;
Once your library is imported, you can use its Notification service
// You can now use this library service to show popup anywhere in angular app;;
API
Ng6NotifyPopupService.setConfig( options: object )
This method can be used to override the default configuration provided by the module. All params are optinal
Ng6NotifyPopupService.setConfig
Ng6NotifyPopupService.show( text: string, options?: object )
show()
method can be called with an optional second argument to override the global default config
// Simple notificationNg6NotifyPopupService.show"Success";// Notification with optionsNg6NotifyPopupService.show"Error occured", //Show notification inside a division (MUST have position:relative)Ng6NotifyPopupService.show"Inside a div",
Ng6NotifyPopupService.destroy()
// Destroy any active notificationNg6NotifyPopupService.destroy;
Custom type
You can create your own type
in CSS as follows
.trb-wild { background-color: #f4a460; }
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
License
MIT © Mark Bezrukaviy MIT © Shubhangi Gupta