npm install ngx-toastr
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { ToastrModule } from "ngx-toastr";
@NgModule({
imports: [
BrowserAnimationsModule,
ToastrModule.forRoot()
]
})
import { ToastrService } from "ngx-toastr";
@Component({
...
})
export class MyComponent {
constructor(private toastr: ToastrService) {}
showMessage() {
this.toastr.success("Message sent successfully!");
}
}
_toastr.scss
file, which can be found in the demo1/src/assets/sass/core/vendors/plugins/
directory. You can also confirm that it is imported in the _plugins.scss
file located in the same directory.