My code is as follows:
<div data-ng-repeat="rule in rules">
       <input type="number" name="ScaleOutThreshold{{$index}}" 
required="true" data-ng-model="rule.ScaleOutThreshold>
      <span ng-show="ScaleOutThreshold{{$index}}.$error.required" 
 class="alert-danger">Required</span>
</div>

but when I empty the value of input type=“number”, the class of span is 
still ng-hide, so the error validation doesn't work, I wonder the reason 
caused that is the using of {{$index}}, but I need the index to distinguish 
the different input number name under ng-repeat.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to