javascript - What it the right way to be noticed when an element with specific directive attribute has been removed from DOM? -
i'm trying find way noticed in case element added , removed dom. in case element removed need ng-model value of element.
for example:
<div tell-me-when-removed ng-model="sometitle"></div> <a ng-click="removethedivabove()"></a>
i'm trying "sometitle"
you can use
scope.$on('$destroy', function() { //your stuff here });
Comments
Post a Comment