Skip to content

Commit

Permalink
feat: add classes indicating form field status
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrobin committed Oct 23, 2023
1 parent 8687663 commit 6ba4534
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/platform/src/lib/signal-input.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import {SIGNAL_INPUT_MODIFIER, SignalInputModifier} from "./signal-input-modifie
'[class.control-valid]': 'this.formField?.state() === "VALID"',
'[class.control-invalid]': 'this.formField?.state() === "INVALID"',
'[class.control-pending]': 'this.formField?.state() === "PENDING"',
'[class.control-pristine]': 'this.formField?.dirtyState() === "PRISTINE"',
'[class.control-dirty]': 'this.formField?.dirtyState() === "DIRTY"',
'[class.control-touched]': 'this.formField?.touchedState() === "TOUCHED"',
'[class.control-untouched]': 'this.formField?.touchedState() === "UNTOUCHED"',
'[class.ng-valid]': 'this.formField?.state() === "VALID"',
'[class.ng-invalid]': 'this.formField?.state() === "INVALID"',
'[class.ng-pristine]': 'this.formField?.dirtyState() === "PRISTINE"',
'[class.ng-dirty]': 'this.formField?.dirtyState() === "DIRTY"',
'[class.ng-touched]': 'this.formField?.touchedState() === "TOUCHED"',
'[class.ng-untouched]': 'this.formField?.touchedState() === "UNTOUCHED"',
},
})
export class SignalInputDirective implements OnInit {
Expand Down

0 comments on commit 6ba4534

Please sign in to comment.