I have a directive to display an alert message every time a post call succeeds/fails. The alert for the first post always succeeds but if I close the alert, and trigger another post the alerts don't show anymore.
Some code below:
Include tag in html
<alert message="notification"></alert>
Directive
app.directive("alert", function(){ return{ restrict: 'EA', templateUrl: "alert.html", replace: false, transclude: false, scope: { message: "=", close: "&" }, link: function(){ } }; }); Template
<div class="alert alert-{{message.type}}" ng-show="message.text"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> <div>{{message.text}}</div> </div> UPDATE: http://plnkr.co/edit/mECmQNSgW0EdXZGPmkNx?p=preview
Any thoughts?
Thanks in advance.