[英]$dirty is always false if I display form using ng-show
I have two forms which I want to display conditionally, so I use ng-show for that.我有两种形式想要有条件地显示,所以我使用 ng-show 。 Now I'm using $dirty for validation purpose but in my case $dirty is always equal to false even if I enter some value in my input field.
现在我使用 $dirty 进行验证,但在我的情况下,即使我在输入字段中输入某个值, $dirty 也始终等于 false。
Any Idea ?任何的想法 ?
I had the same problem.我有同样的问题。 In my case I had just forgotten the ng-model in the input fields so there actually nothing was dirty.
就我而言,我刚刚忘记了输入字段中的 ng-model,所以实际上没有什么是脏的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.