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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -