I have a form with many input fields that are validated by AngularJS.
How can ignore one of them only from being validated ? It is only used as a commodity for the user to enter a value and add a row to a grid (which is part of the form).
<input type="text" ng-model="url" >
<button class="btn btn-primary btn-xs" ng-click="addUrl();">+</button>
In the above code, the user enters some text in the input and click the + button. The problem is that the input is validated by AngularJS when the form is submitted, which is not what I want.
I've tried adding ng-non-bindable to the input. That works but then I can't bind the 'url' property obviously....
What's the workaround for this ?
name
, shouldn't get validated since it is not able to be submitted – charlietfl Nov 19 '13 at 15:20$dirty
property of a form after the user clicks the button andaddUrl()
is called. See$setPristine
: docs.angularjs.org/api/ng.directive:form.FormController – m.e.conroy Nov 19 '13 at 15:27