pb-ngx-toast
v3.5.2
Published
a custom toast ie9 compatible
Downloads
110
Maintainers
Readme
Custom messages service
This project contains a toast message library
Quick Start
# Install package
npm i pb-ngx-toast --save
# Import css style.css
@import '../node_modules/pb-ngx-toast/style.css';
# Add component markup
<ngx-toast-queue></ngx-toast-queue>
# Import module in your app module
import { ToastrModule } from "pb-ngx-toast";
@NgModule({
imports: [
BrowserModule,
ToastrModule
],
declarations: [
AppComponent
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
# Calling service
constructor(private _toastrService: ToastrService)
# Default configuration
let configuration : new ToastrConfig =
{
position: ToastPositionEnum.BOTTOM_RIGHT,
timeout: 5000,
progressBar: true
}
# Example messages
this._toastrService.success(message, title, configuration);
this._toastrService.error(message, title, configuration);
this._toastrService.warning(message, title, configuration);
this._toastrService.info(message, title, configuration);