我正在使用ng-messages指令在我的角度应用中进行即时验证。我有2个电话号码字段和2个电子邮件字段。这四个领域中的一个需要提交表格。如何验证这个?这四个字段是通过单击添加电话或添加电子邮件链接动态生成的。
请转到这个小提琴:http://jsfiddle.net/selvassn/rjqbpfkm
<form name="Form">
<div class="form-group">
<label>Phone1</label>
<input type = "text" ng-model="phone1" required>
<span class="help-block"
ng-show="Form.phone1.$error.required">Required</span>
</div>
<div class="form-group">
<label>Phone2</label>
<input type = "text" ng-model="phone2" required>
<span class="help-block"
ng-show="Form.phone2.$error.required">Required</span>
</div>
<div class="form-group">
<label>Email1</label>
<input type = "text" ng-model="email1" required>
<span class="help-block"
ng-show="Form.email1.$error.required">Required</span>
</div>
<div class="form-group">
<label>Email21</label>
<input type = "text" ng-model="email2" required>
<span class="help-block"
ng-show="Form.email2.$error.required">Required</span>
</div>
</form>