Hello. I have a routine that checks the elements of a form-group and adds the has-error class in form-validate. See below
var allElements = element.find("input");
for(var i = 0; i < allElements.length; i++) {
var field = angular.element(allElements[i]);
if(field.parent().parent().hasClass('has-error')){ field.parent().parent().removeClass('has-error');
}
}
AND FORM-GROUP IS SO
<div class="form-group">
<div class="input-group plain-addon">
<div class="input-group-addon"><span class="fa fa-user fa-fw"></span></div>
<input type="text" ng-model="user.nickname" class="form-control" placeholder="Nome" name="nickname" required>
</div>
<span class="help-block"><span class="help-block">Campo obrigatório</span></span>
</div>
I now need to hide the Required field and only show when has-error . I'm starting angularjs now