Hey there! I'm currently working with Angular Toastr to display messages on my screen. I have a setup where only two messages can be open at the same time - one for errors and another for warnings. These messages are persistent and require user interaction to close.
I am triggering the messages as per the instructions provided:
app.controller('foo', function($scope, toastr) {
toastr.error('This is your error message', 'Error');
toastr.warning('This is your warning message', 'Warning');
});
However, I'm interested in understanding how I can detect when a user closes one of these messages and which specific message it was. The documentation mentions callbacks such as onHidden and onShown, but I'm unsure about how to implement them due to lack of detailed information. Additionally, there seems to be an isOpened flag that can determine if a message is currently displayed.
If anyone could guide me on utilizing these callbacks to execute certain actions once a toastr message is closed, I would greatly appreciate it. This is my first experience with Angular Toastr and I'm finding it a bit challenging.