An easy to use alert library for Angular 2.
npm install --save @jaspero/ng2-alerts
A demo can be found here
JasperoAlertsModule in your
Then create the component in a root component (you can create it anywhere but you can only use it in that component on any lower ones).
How To Use
You need to import the
AlertsService in your component:
constructorprivate _alert: AlertsService
Then use the
create(type: 'success' | 'error' | 'wearning', 'info', message: string, settings: AlertSettings) method to initiate an alert.
You can provide the settings as input to the
Making the settings default for each created alert. However you can also override the settings by
passing them in the