angular-x-alerts
v1.1.1
Published
Simple Angular 2+ alert module
Downloads
33
Maintainers
Readme
DEMO
Install
npm install angular-x-alerts
Usage
<!-- add this line on top of your app.component.html -->
<ngx-alert></ngx-alert>
import { AlertModule } from 'angular-x-alerts';
//...
const options = { persist: { success: false, error: true, warn: true, info: true } }
@NgModule({
imports: [
BrowserModule,
AlertModule.forRoot(options) // <---- HERE
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
Example
constructor(public alert: AlertService){
alert.success("Hello World !");
}
API
- success(message: string)
- error(message: string)
- info(message: string)
- warn(message: string)