implementing jQuery.contains() in jqLite (AngularJS)

166 views Asked by At

I'm writing a library in which I need to check if an element is detached from the DOM before doing operations on it, because it is possible that the element is removed from outside the library. This would be possible as follows: jQuery.contains(document, myJqLiteElement). However, jqLite does not include such a function. In order to remove jQuery as an dependency for my library, I need to figure out an alternative. One way to solve it, is by implementing some API point at which a user can signal to this library that an element was removed. This is not a very elegant method, however.

What is an alternative implementation for jQuery.contains() in jqLite (AngularJS)?

0

There are 0 answers