AngularJS:SetValidity在NG-重复场 [英] AngularJS: SetValidity in ng-repeat fields

查看:261
本文介绍了AngularJS:SetValidity在NG-重复场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个生成使用NG-重复某些字段的形式。我要附加的每个独立的字段设置有效性情况下,它为空。有没有办法做到这一点?

I have a form that generates some fields using ng-repeat. I want to attach each independent field to set validity in case it is left empty. Is there a way to do this?

谢谢!

推荐答案

这不会在表单重复的项目工作。该表格​​将始终默认为最后创建的控制。

This doesn't work for repeated items in the form. The form will always default to the last created control.

使用$指数和设置表单名称repeatForm {{指数}}

Use $index and set your Form name to repeatForm{{index}}

这篇关于AngularJS:SetValidity在NG-重复场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆