angular-alert-module
Installation
To install this library, run:
$ npm install angular-alert-module --save
Consuming your library
Once you have published your library to npm, you can import your library in any Angular application by running:
$ npm install angular-alert-module
and then from your Angular AppModule
:
;; ; // Import your library;
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html --> {{title}}
Add this code in any of the component which needs to show alert
; //and add a line in constructor to get services instance constructorprivate alerts: AlertsService //then use it like this - I've made it for ngOnInit and you can use it anywhere in componentngOnInit
To alter alert timings and add more alert types
; //get the alert service instance in constructor constructorprivate alerts: AlertsService ngOnInit
/* Specific css for <Alert Type> *//* Specific css for <Alert Type> */
Development
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
License
MIT © sudhakar pilavadi