本文介绍了将单个输入元素设置为ng-pristine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道表单元素有一个$ setPristine()函数,如果我想将single设置为ng-pristine单元素标签(如<input>),是否有一个等效项?

I know there is a $setPristine() function for the form element, is there an equivalent if I want single to set to ng-pristine single element tags like <input>?

推荐答案

原始的概念适用于整个形式,而不适用于单个元素.原始形式是尚未更改的形式,而脏形式是已更改的形式.没有将与表单无关的输入元素标记为原始的语义,对于表单中的输入元素,原始标志仅适用于表单.

The concept of pristine applies to a form as a whole and not to individual elements. A pristine form is one which has not yet been modified while a dirty form is one that has been changed. There are no semantics of flagging a input element unrelated to a form as pristine and for input elements in a form, the pristine flag applies solely to the form.

这篇关于将单个输入元素设置为ng-pristine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 09:31