$scope.optionArray = 'ABCDEFG'.slice(0,4).split('');
<select class="form-control form_items_sm form_items" name="optionAmount" ng-model="optionAmount" ng-options="o for o in optionAmounts" ng-change="updateArray(optionAmount)" required></select>
<div ng-repeat="i in optionArray">
<h4 class="form_items_title">选项{{i}}<span class="error" ng-show="problemForm['optionContent[{{i}}]'].$invalid && problemForm.submitted">此为必填项</span></h4>
<input class="form-control form_items_md form_items" name="optionContent[{{i}}]" ng-model="optionContent[i]" required>
</div>
angularjs表单验证form里单独元素能直接用.访问其数据状态($valid,$dirty等)
数组类元素则需用[]访问其数据状态
这东西有点恶心啊,调了半天偶然看到。。