mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(dialog): document how to set default options using MAT_DEFAULT_DIALOG_OPTIONS (#9319)
* docs(dialog): document how to set default options * docs(form-field): fix typo * Address comments
This commit is contained in:
@@ -39,6 +39,18 @@ export class YourDialog {
|
||||
}
|
||||
```
|
||||
|
||||
### Specifying global configuration defaults
|
||||
Default dialog options can be specified by providing an instance of `MatDialogConfig` for
|
||||
MAT_DIALOG_DEFAULT_OPTIONS in your application's root module.
|
||||
|
||||
```ts
|
||||
@NgModule({
|
||||
providers: [
|
||||
{provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: false}}
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
### Sharing data with the Dialog component.
|
||||
If you want to share data with your dialog, you can use the `data` option to pass information to the dialog component.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ present in the form field control. It can also be set to `auto` to restore the d
|
||||
|
||||
<!-- example(form-field-label) -->
|
||||
|
||||
Global default label options can be specified by setting providing a value for
|
||||
Global default label options can be specified by providing a value for
|
||||
`MAT_LABEL_GLOBAL_OPTIONS` in your application's root module. Like the property, the global
|
||||
setting can be either `always`, `never`, or `auto`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user