angularjs – 角度 – 原始/脏和触摸/未触摸之间的差异

前端之家收集整理的这篇文章主要介绍了angularjs – 角度 – 原始/脏和触摸/未触摸之间的差异前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Angular official docs about forms告诉有许多关于表单和字段的样式和指令。对于每一个,一个CSS类:
ng-valid
ng-invalid
ng-pristine
ng-dirty
ng-touched
ng-untouched

原始/肮脏,触摸/未触摸之间有什么区别?

API Reference for CSS classes used by angular
  • @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相关文章