I am applying toasterjs in my angular component. Here is my code.
i have imported the ToastrService
using the code:
import { ToastrService } from 'ngx-toastr';
and inject that service in the constructor
constructor(private toastrService: ToastrService) {
}
this.toastrService.success('You are awesome!', 'Success!',)
But it is giving the following error:
Can't resolve all parameters for ToastrService: (?, [object Object], [object Object], [object Object], [object Object])
When I go to its definition, then it is taking 4 parameters. Here are the parameters:
success(message?: string, title?: string, override?: Partial<IndividualConfig>): ActiveToast;
I have added the module also:
imports: [
ToastrModule.forRoot(),
CommonModule,
HttpModule,
FormsModule,
ReactiveFormsModule,
TextboxModuleShared,
DateTimeModuleShared,
DropdownModuleShared
],
So how can I use the parameters because I want to only show success message?