具有这个普通(名称属性由服务器请求)形式与角度,并不能弄清楚如何使验证工作.我应该把什么投入到ng-show ="TODO"中
<div ng-app>
<form ng-init="variants = [{duration:10, price:100}, {duration:30, price:200}]">
<div ng-repeat="variant in variants" ng-form="variant_form">
<div>
<label>Duration:</label>
<input name="variants[{{$index}}][duration]" ng-model="variant.duration" required />
<span ng-show="TODO">Duration required</span>
</div>
<div>
<label>Price:</label>
<input name="variants[{{$index}}][price]" ng-model="variant.price" />
<span ng-show="TODO">Price required</span>
</div>
</div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
ps:这只是一种形式,更复杂
谢谢
angularjs ×1