How can I skip validation of nested forms with AngularJS? I have to make an outer form valid even when its child form is invalid.
In the example below outer form sh
From your controller :
Ctrl.isOuterFormValid = function() {
var outerFormIsValid = true;
for(var prop in Ctrl.formName) {
//The form is only inValid if the property is not a new form and it is invalid
if(pvCtrl.pvForm[prop].constructor.name !== "FormController" &&
pvCtrl.pvForm[prop].$invalid){
outerFormIsValid = false;
}
}
alert(outerFormIsValid);
};
FormController is an Object that gives you information about your form state.
Adding a form to a form, with ng-form is adding a FormController property to your original FormController Object.
This has the advantage of not adding a html directive to all your input elements.