AngularJS-原始/脏污和触摸/未触摸之间的区别 [英] AngularJS - difference between pristine/dirty and touched/untouched

查看:124
本文介绍了AngularJS-原始/脏污和触摸/未触摸之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AngularJS开发人员指南-表单告诉您有关表单和字段的样式和指令很多.对于每个,一个CSS类:

AngularJS Developer Guide - Forms tell there are many styles and directives regarding forms and fields. For each one, a CSS class:

ng-valid
ng-invalid
ng-pristine
ng-dirty
ng-touched
ng-untouched

pristine/dirtytouched/untouched有什么区别?

推荐答案

AngularJS开发人员指南-CSS类由AngularJS使用

  • @property {boolean} $ untouched如果控件尚未失去焦点,则为True.
  • @property {boolean} $ touched如果控件失去焦点,则为True.
  • @property {boolean} $ pristine如果用户尚未与控件交互,则为true.
  • @property {boolean} $ dirty如果用户已经与控件进行了交互,则为true.
  • @property {boolean} $untouched True if control has not lost focus yet.
  • @property {boolean} $touched True if control has lost focus.
  • @property {boolean} $pristine True if user has not interacted with the control yet.
  • @property {boolean} $dirty True if user has already interacted with the control.

这篇关于AngularJS-原始/脏污和触摸/未触摸之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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