UNPKG

wsuite-notification

Version:

Toast notification for angular 2,4,5,6,7,8+ version.

50 lines (37 loc) 958 B
## Features - Toast notification for wsuite UI-UX. - AoT compilation and lazy loading compatible ## Install ```bash npm install wsuite-notification --save ``` ## Setup **step 1:** add WsuiteNotificationModule to app NgModule ```typescript import { CommonModule } from '@angular/common'; import { WsuiteNotificationModule } from 'wsuite-notification'; @NgModule({ imports: [ CommonModule, WsuiteNotificationModule.forRoot() // WsuiteNotificationModule.forRoot({ timeout: 5000 }) ], bootstrap: [App], declarations: [App] }) class MainModule {} ``` **step 2:** add in your root component html (Ex. AppComponent) ```html <wsuite-notification></wsuite-notification> ``` ## Use ```typescript import { NotificationService } from 'wsuite-notification'; @Component({...}) export class YourComponent { constructor(private toastr: NotificationService) {} showSuccess() { this.toastr.success('Hello world!', 'Toastr fun!'); } } ```