AngularJS - difference between pristine/dirty and touched/untouched

后端 未结 4 844
生来不讨喜
生来不讨喜 2020-11-30 17:32

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-pri         


        
4条回答
  •  盖世英雄少女心
    2020-11-30 17:51

    AngularJS Developer Guide - CSS classes used by AngularJS

    • @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.

提交回复
热议问题