2.2.9 • Published 4 years ago

ngrx-toastr v2.2.9

Weekly downloads
21
License
ISC
Repository
github
Last release
4 years ago

Toastr

Setup

step1: Add ToastrModule to app NgModule

import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core';

import { ToastrModule } from './toastr/toastr.module';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    ToastrModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use

import { ToastrService } from 'ngrx-toastr';
 
@Component({...})
export class YourComponent {
  constructor(private toastr: ToastrService) {}
 
  showSuccess() {
    this.toastr.success('Hello world!', 'heading', 'sub heading');
  }
}

Options

There are Individual Options and Global Options.

Individual Options

Individual Options

Passed to ToastrService.success/warning/error()

OptionType
messageany
Headingany
SubHeadingany

Global Options

Pass values to ToastrModule.forRoot()

OptionTypeDefault
positionClassstring'toast-top-right'
timeOutnumber5000
maxToastrnumber5
// root app NgModule
imports: [
  ToastrModule.forRoot({
    timeOut: 5000,
    positionClass: 'toast-top-right',
    maxToast: 5
  }),
]
2.2.9

4 years ago

2.2.8

4 years ago

2.2.7

4 years ago

2.2.6

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.1.4

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago