Is it possible to create an array that contains references to the fields in a form (such as input, textarea, etc.) and then run a function on them in my code, like addClass()
?
To clarify my objective - I am looking to add a red border color to any invalid inputs after the user submits the form (and triggers the submit() function in the controller).
ng-class="{'has-error':form.input.$invalid}"
Unfortunately, this approach is not yielding the desired results.