0
I have a question with Angularjs, I am making a registration form, and has a certain form that I am doing a validation and has an option to insert multiple phones, it enters the phones clears the input data and goes to a list with angular repeat.
My doubt is, when I enter at least 1 phone, it will remove the mandatory field (required), or set the field as valid.
I tried to use the $setValidity();
but it wasn’t also what I’m doing wrong?
Excerpt from the code I’m using
var $formElem,$formScope;
$formElem = angular.element(formCliente);
$formScope = $formElem.scope();
$formScope.formCliente.telefone.$setValidity('required', false);
Worse than in the structure of the code I made, it needs to use the attribute 'required' even, because it is an automatic validator, I pass the form, and it displays me in a popup the fields of the form divided into tabs, the fields that are mandatory and are not filled in
– Jovelino Stival
yes, but Voce Voce will go through this 'property' now.. and no longer through the model field linked to its input
– andrepaulo