- 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:
- Import the module using ToastrModule.forRoot()
before
@NgModule({
imports: [
ToastrModule
]
})
export class AppModule { }
after
@NgModule({
imports: [
ToastrModule.forRoot()
]
})
export class AppModule { }
- 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;
}
}