Topic: Preventing alerts duplicates
Arkadiusz Idzikowski staff answered 6 years ago
Dear mdb2,
Inject ToastService to your component typescript file and try to change 'maxOpened' option with this code:
constructor(private toastrService: ToastService) { }
this.toastrService.toastConfig.maxOpened = 3;
Regards,
Arek
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Damian Gemza staff commented 6 years ago
Dear mdb2, There's no possibility to change maxOpened value during your application lifecycle. Instead of it, please try to set maxOpened as 1, and add preventDuplicates: true. Maybe this way will fit your needs. https://mdbootstrap.com/angular/advanced/alerts/#options Best Regards, Damianmdb2 pro commented 6 years ago
I assume that preventDuplicates only prevent exactly the same alerts. In my case they are similar but not identical. In jquery it was working fine