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.