FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: mention `getError()` in signal forms skill by msmallest · Pull Request #71166 · angular/angular · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ const value = this.userForm().value();
const isValid = this.userForm().valid();
const isInvalid = this.userForm().invalid();
const errors = this.userForm().errors(); // Array of errors
const error = this.userForm().getError('...'); // Single error, by error `kind`
const isPending = this.userForm().pending(); // Async validation pending

// Interaction State (Signals)
Expand Down Expand Up @@ -291,6 +292,8 @@ interface ValidationError {
}
```

`field().getError('...')` returns a single ValidationError by its `kind`.

Do _NOT_ return null from validators.
When there are no errors, return undefined

Expand Down
Loading

Back | FazBrowse Home | New Git URL