marcorinck / angular-growl

growl-like notifications for angularJS projects
MIT License
478 stars 191 forks source link

Duplicate Timer Reset & Clear All #24

Open JohnYoungers opened 10 years ago

JohnYoungers commented 10 years ago

I just started playing with this a bit and I think the directive could benefit from the following functionality:

1) If there's already a duplicate message up, set that message's timeout to be the timeout of the new message (or just remove the old and add the new). Otherwise a new message could be added (which is a duplicated) and then quickly closed because the original's timer was nearing expiration

2) It would be helpful if you could clear out all messages. If I added an error message with a list of form input issues (without a timer), I would want that message to be removed if the user hasn't already the next time they try to submit the form. Or at least have the 'add' method return a reference to the popup that can be closed