Skip to content

chan4lk/toastr

Repository files navigation

Toastr

Install

npm install @chan4lk/toastr

Configure

import { ToastrCoreModule, CLOSE_LABEL } from '@chan4lk/toastr/core';
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, ToastrCoreModule],
  providers: [{
    provide: CLOSE_LABEL,
    useValue: 'hide'
  },],
  bootstrap: [AppComponent],
})
export class AppModule {}

Show Message

export class AppComponent {
  constructor(private toastr: ToastrService) {
    this.toastr.show({
      message: 'Test message',
      isSuccessMessage: false,
    });
  }
}