angular toaster plunker code example
Example: angular toastr
npm install ngx-toastr --save
npm install @angular/animations --save
"styles": [
"styles.scss",
"node_modules/ngx-toastr/toastr.css"
]
import { CommonModule } from '@angular/common';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ToastrModule } from 'ngx-toastr';
imports: [
CommonModule,
BrowserAnimationsModule,
ToastrModule.forRoot(),
],
import { ToastrService } from 'ngx-toastr';
constructor(private toastr: ToastrService) {}
showSuccess() {
this.toastr.success('Hello world!', 'Toastr fun!');
}