docs: provide example for global ErrorStateMatcher for standalone apps#29219
docs: provide example for global ErrorStateMatcher for standalone apps#29219michael-small wants to merge 3 commits intoangular:mainfrom
ErrorStateMatcher for standalone apps#29219Conversation
1) "remove empty code block" I added an extra `ts` code block example on accident in the previous PR 2) "rename comment": Change `Module` to `NgModule` for the existing example
| globally cause input errors to show when the input is dirty and invalid. | ||
|
|
||
| ```ts | ||
| // NgModule applications |
There was a problem hiding this comment.
Can you split these into 2 separate code blocks? When its shown as one, I worry people might think they need to copy the entire snippet
There was a problem hiding this comment.
Good idea. Can it be two adjacent blocks like this
// NgModule applications
@NgModule({
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
})// Standalone applications
export const appConfig: ApplicationConfig = {
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
};or should the comments be pulled out into something like normal text above the blocks
There was a problem hiding this comment.
@mmalerba sorry if it's gauche to @ you but I just remembered this PR.
Thoughts?
crisbeto
left a comment
There was a problem hiding this comment.
Looking through old docs PRs: this needs a rebase.
|
Looks like #32840 covered this recently, very nice. Closing. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Relevant documentation page: https://material.angular.io/components/input/overview#changing-when-error-messages-are-shown
Edit: other page https://material.angular.io/components/select/overview#changing-when-error-messages-are-shown
ErrorStateMatcheris very useful, especially when added globally. This PR would add an example on how to use it globally in standalone applications.