Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: provide example for global ErrorStateMatcher for standalone apps #29219

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/material/input/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ applies to all inputs. For convenience, `ShowOnDirtyErrorStateMatcher` is availa
globally cause input errors to show when the input is dirty and invalid.

```ts
// NgModule applications
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NgModule({
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
})

// Standalone applications
export const appConfig: ApplicationConfig = {
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
};
```

### Auto-resizing `<textarea>` elements
Expand Down
8 changes: 8 additions & 0 deletions src/material/select/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,19 @@ applies to all inputs. For convenience, `ShowOnDirtyErrorStateMatcher` is availa
globally cause input errors to show when the input is dirty and invalid.

```ts
// NgModule applications
@NgModule({
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
})

// Standalone applications
export const appConfig: ApplicationConfig = {
providers: [
{provide: ErrorStateMatcher, useClass: ShowOnDirtyErrorStateMatcher}
]
};
```

### Keyboard interaction
Expand Down
Loading