Is there any convenient way to check if a DOM element is `$compile`d in AngularJS?
- by Tong Shen
I'm trying to integrate some plain JavaScript library with AngularJS, in which I need to manually $compile some DOM elements. I'm doing the compilation like this:
$compile(e.srcElement)($scope);
e.srcElement is the DOM element I want to $compile.
I wonder, if there is any established way to check if a given DOM element has been compiled.
I know it's possible if I attach some data attributes to the DOM during compiling, and try to retrieve that later. What I want to know is if there is any existing method in AngularJS.
Thank you!