문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| angular:forms [2019/01/16 04:11] – [Template Driven Forms (TDF)] taekgu | angular:forms [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 23: | 줄 23: | ||
| * Readablility decreases with complex forms and validations | * Readablility decreases with complex forms and validations | ||
| * Suitable for simple scenarios | * Suitable for simple scenarios | ||
| + | === Track Control State and validity === | ||
| + | <code javascript> | ||
| + | <input type=" | ||
| + | </ | ||
| + | 해쉬(# | ||
| + | 적용되는 class는 < | ||
| + | ^State ^Class if true ^Class if false^ | ||
| + | |The control has been visited.|ng-touched|ng-untouched| | ||
| + | |The control' | ||
| + | |The control' | ||
| + | |||
| + | === ngModel properties === | ||
| + | ^Class | ||
| + | |ng-untouched | ||
| + | |ng-touched | ||
| + | |ng-pristine | ||
| + | |ng-dirty | ||
| + | |ng-valid | ||
| + | |ng-invalid | ||
| + | |||
| + | <code javascript> | ||
| + | <div class=" | ||
| + | < | ||
| + | <input type=" | ||
| + | </ | ||
| + | {{ name.className }} | ||
| + | {{ name.touched }} | ||
| + | </ | ||
| + | # | ||
| + | |||
| + | === class property적용 === | ||
| + | <code javascript> | ||
| + | <input type=" | ||
| + | </ | ||
| + | **[class.is-invalid]=" | ||