2016年1月28日星期四

form, component


控件
* @property {Object} $error An object hash with all failing validator ids as keys.
* @property {Object} $pending An object hash with all pending validator ids as keys.
*
* @property {boolean} $untouched True if control has not lost focus yet.没摸过
* @property {boolean} $touched True if control has lost focus.摸过,并失去了。
* @property {boolean} $pristine Truerol if user has not interacted with the cont yet.没交互过
* @property {boolean} $dirty True if user has already interacted with the control.交互过
* @property {boolean} $valid True if there is no error.合法
* @property {boolean} $invalid True if at least one error on the control.非法
* @property {string} $name The name attribute of the control.


form
 * @property {boolean} $pristine True if user has not interacted with the form yet.没交互
 * @property {boolean} $dirty True if user has already interacted with the form.已交互
 * @property {boolean} $valid True if all of the containing forms and controls are valid.合法
 * @property {boolean} $invalid True if at least one containing control or form is invalid.非法
 * @property {boolean} $submitted True if user has submitted the form even if its invalid.已提交,就算没提交成功也是已提交。



区分一下






 $dirty和$pristine是相反的
 $dirty是交互过,比如获得了焦点,并且输入了东西(比如输入A,然后删掉A)。
 $touched只是获得过焦点。

没有评论:

发表评论