github scttcper/ngx-toastr 3.0.0

latest releases: v14.2.2, v14.2.1, v14.2.0...
7 years ago
  • Fixes AoT when setting global settings #32
  • Makes ToastConfig not injectable and no longer provided globally for no reason
  • I believe using forRoot should prevent multiple instances of the service from being started when used properly #30
  • removes provideToastr for settings that should be set inside a component see breaking changes or https://github.com/scttcper/toastr-ng2#override-default-settings

##Breaking changes:

  1. Import the module using ToastrModule.forRoot()

before

@NgModule({
  imports: [
    ToastrModule
  ]
})
export class AppModule { }

after

@NgModule({
  imports: [
    ToastrModule.forRoot()
  ]
})
export class AppModule { }
  1. Inject ToastrConfig, typically in your root component, and customize the values of its properties in order to provide default values for all the timepickers used in the application.
import { ToastrConfig } from 'toastr-ng2';
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(config: ToastrConfig) {
    // your global config here
    config.timeOut = 100;
  }
}

Don't miss a new ngx-toastr release

NewReleases is sending notifications on new releases.