Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

wsuite-notification

wsuite-team290.0.11TypeScript support: included

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

Notification, Angular, toast, Wsuite, Wsuite Team, Angular Notification, Angular toast, ng-toast, ng-notification

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