I would like to show various types of messages (success, error, warn, info, etc.) after making REST calls and other actions. The message should fade out after N seconds. What is the best way to achieve that.
I have tried to use ng-switch for the various message types where each DIV has a directive "fade-out" that fades out the message after N seconds. This kinda works but is not very maintainable for numerous message types.
<div ng-switch on="createActivityResult">
<div ng-switch-when="success" fade-out class="alert alert-success">SUCCESS</div>
<div ng-switch-when="error" fade-out class="alert alert-error">ERROR</div>
...
</div>
Any help is greatly appreciated.
Best,
-- Thomas