[英]How to validate the dynamically created form using angularjs?
Actually I'm creating the form dynamically and i have done two way binding also. 实际上,我是动态创建表单的,并且我也完成了两种方式的绑定。 Now I want to do the validation. 现在我要进行验证。
Requirements: 要求:
$watch
or $dirty
we can check that modified or not. 如果使用$watch
或$dirty
编辑该值,我们可以检查是否已修改。 The same thing I want to get reverse also. 同样的事情我也想扭转。 Suppose I edited the value Raja to Raj and later again i'm adding the 'a' means Raja. 假设我将Raja的值编辑为Raj,稍后再添加“ a”表示Raja。 If i give previous value again the status $dirty
i should get false. 如果我再次赋予先前的值$dirty
状态,我应该为假。 Please help me anyone on this. 请帮助我任何人。
Here is my Plunker for simple example. 这是我的简单例子。
您应该使用类似$setPristine()
东西http://plnkr.co/edit/1LJ5alREMhFXOqO8ZWbj?p=preview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.