Closed blanchma closed 9 years ago
I have the same issue. I check the source code and I fail to understand why. The alert template generate a ng-click='close()' that should close the alert box as soon as we click on it, doesn't it ?
The alert directive declares the following scope:
scope: {
type: '=',
close: '&'
}
Thus, when the close button is clicked, the expression within the close attribute is evaluated. It is up to you to actually remove the alert element from the DOM (this is usually accomplished via a ng-if
, ng-show
, or ng-hide
).
The documentation is lacking here. :no_mouth:
Thank you for this quick response. It effectively works. Oviously the chosen var name has to be unique to each alert box, or in one click you close all of them.
<alert data-ng-hide="closeAlert1" close="closeAlert1=true"> dfsdfsdf</alert>
<alert data-ng-hide="closeAlert2" close="closeAlert2=true"> 1234</alert>
Many thanks!
The close button is rendered but when I click it, nothing happen.