wsuite-notification
v0.0.11
Published
Toast notification for angular 2,4,5,6,7,8+ version.
Downloads
16
Maintainers
Readme
Features
- Toast notification for wsuite UI-UX.
- AoT compilation and lazy loading compatible
Install
npm install wsuite-notification --save
Setup
step 1: add WsuiteNotificationModule to app NgModule
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)
<wsuite-notification></wsuite-notification>
Use
import { NotificationService } from 'wsuite-notification';
@Component({...})
export class YourComponent {
constructor(private toastr: NotificationService) {}
showSuccess() {
this.toastr.success('Hello world!', 'Toastr fun!');
}
}