<div ng-repeat="PhoneNumber in PhoneNumbers">
<div class="form-group">
<div class="col-sm-5">
@Html.TextBox("PhoneNumber[{{$index}}].Phone", null, new {ng_required="true",@class = "form-control space-bottom",placeholder = "Your Phone Number", ng_modal = "{{PhoneNumber.Phone}}"})
<div ng-show="subForm.$submitted
||subForm['PhoneNumber['{{$index}}'].Phone'].$touched">
<span class="text-danger" ng-
show="subForm['PhoneNumber['{{$index}}'].Phone'].$error.required">
Tell us your Phone.</span>
</div>
</div>
<div class="col-sm-5">
@Html.DropDownList("PhoneNumber[{{$index}}].Ranking", new
SelectList(Enum.GetValues(typeof(RankPhone))),
"", new { @class = "form-control space-bottom", ng_modal = "
{{PhoneNumber.Ranking}}", ng_required="true"})
<div ng-show="subForm.$submitted ||
subForm['PhoneNumber['{{$index}}'].Ranking'].$touched">
<span class="text-danger" ng-
show="subForm['PhoneNumber['{{$index}}'].Ranking'].$error.required">
Rate your Phone.</span>
</div>
</div>
</div>
</div>
&#13;
我正在使用电话簿和模板(asp .net)是一个电话列表,可以使用角度创建动态表单。问题是必须要求手机输入,并且ng-required不起作用。