// --- app.module.ts
...
imports: [
....
BrowserAnimationsModule,
ToastrModule.forRoot({
timeOut: 1000,
positionClass: 'toast-bottom-right'
}),
....
],
...
// --- app.module.ts
// --- Component in child module
...
ngOnInit(): void {
this._toastr.success('DC Retrived', 'Toaster test', {
timeOut: 3000,
});
}
...
// --- Component in child module
I tried importing the toastr css in app.module.scss and in angular.json and nothing worked.
Possibly
ngOnInitis too soon. Try this:And in angular.json:
Note you will have to restart the Angular dev server to pick up changes in
angular.json