0.0.11 • Published 3 years ago

wsuite-notification v0.0.11

Weekly downloads
141
License
-
Repository
-
Last release
3 years ago

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!');
  }
}