I am writing a directive in AngularJS, and one of the things I need to do is find all the controls inside the form and iterate over them.
If it was loaded jQuery, I do this:
var inputs = element.find(".ng-invalid,.ng-valid");
inputs.each(function ()
{
var i = $(this);
});
But since it is not loaded, and I just have it Angular, I can only think to do something like:
var inputs = element.find("input");
//for loop thru this
var selects = element.find("select");
//for loop thru this
//....etc
Is there a better way to use jQLite to accomplish this?
source
share