javascript - removing scope does not work -


unfortunately did not find answer myself in documentation or in google, maybe can me find out 1 thing. imagine have directive "mydirective". located on div element. when remove div using remove method jquery, "$destory" event triggered on dom node. scope of "mydirective" still exists. can listen "$destroy" on div element , manually call scope.$destroy(), why angular not this?

use integrated jqlite instead of jquery. example :

angular.element(yourelement).remove(); 

documentation angular.element

after, if have problem, reset scope variable related directive (if exists) :

$scope.yourelement = {}; 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -