I want to find the name of the model on the active element. Basically I have document.activeElement how do I find out what it's ng-model is.
Here is the Fiddle
You need to get the element object as discribed in the comment in the code and then access it with
// get element var result = document.getElementsByTagName("input"); // get object using jQLite or jQuery var ele = angular.element(result); // access 'ng-model' as 'attribute' alert(ele.attr('ng-model'));
CAUTION: Here it's shown just for example considering just one input element. Use proper class/element/attribute
selector to get proper element you want to target.