Bot releases are visible (Hide)
npm install @angular/animations --save
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
What happened to 5.0.0?
I'm not sure.
Fixed bugs for component inheritance. If you were extending toast you should update the constructor. The values are now protected instead of private which allows for easier inheritance without Angular AoT. The constructor is only necessary when not using AoT.
constructor(
protected toastrService: ToastrService,
public data: ToastData,
protected toastRef: ToastRef<any>,
protected appRef: ApplicationRef,
protected sanitizer: DomSanitizer
) {
super(toastrService, data, toastRef, appRef, sanitizer);
}
onAction
observable passed back from toast creation. This can be used in custom toasts to trigger a selection. This has been added to the pink toast in the demo. #39Big thanks to @yarrgh in #34
// your @NgModule
imports: [
ToastrModule.forRoot({ alwaysOnTop: false, timeOut: 10000 })
]
this.toastrService.success('message', 'title', {timeOut: 10000 });
##Breaking changes:
before
@NgModule({
imports: [
ToastrModule
]
})
export class AppModule { }
after
@NgModule({
imports: [
ToastrModule.forRoot()
]
})
export class AppModule { }
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;
}
}