Topic: ToastService.show() has multiple issues in 8.1.1
Expected behavior
Calling show()
on ToastService should support a message and a toast type, like so: show('This is an error message', null, null, 'error')
. This worked in the 8.0.0 release
Actual behavior
There are a few issues here:
- There isn't a defensive check on the override configuration, so specifying
null
causes an error in the ToastService. This bug/issue was introduced since 8.0.0. I can workaround it by specifying an empty object, but a check onnull
would be more developer friendly. - The 'error' specifies the ToastType. Apparently it's just being added as a class to the toast notification. Previously, in the 8.0.0 release, this would be handled correctly with the appropriate
md-toast-
prefix. In the 8.1.1 release I have to specify this manually.
To make this work in 8.1.1 I now have to do: show('This is an error message', null, {}, 'md-toast-error')
. Can these two issues/differences be updated to how they were in 8.0.0? I'd like my service logic to not care about presentation/CSS classes and for the library to have defensive checks for null. Thanks!
Resources (screenshots, code snippets etc.)
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: 8.1.1
- Device: Any
- Browser: Any
- OS: Any
- Provided sample code: No
- Provided link: No
Arkadiusz Idzikowski staff commented 5 years ago
Thank you for reporting this problems. We will take a closer look at those bugs and fix them as soon as possible.