Search code examples
angularjsscopedestroy

Can I get scope by class?


I need to destroy a particular part of DOM and scope.

$(".panel_block:last").remove();

remove() didnt delete scope. Can I get scope by class to use destroy()?


Solution

  • You can get the scope of an element by using the following code:

    angular.element(document.getElementById('foo')).scope()
    

    Here's some documentation for getElementByClassName()