From acd90669d3b1508e669f71813ebe8526c1f07fb9 Mon Sep 17 00:00:00 2001 From: CDDelta Date: Sat, 13 Jan 2018 04:39:58 +1100 Subject: [PATCH] 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 --- src/lib/dialog/dialog.md | 12 ++++++++++++ src/lib/form-field/form-field.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/dialog/dialog.md b/src/lib/dialog/dialog.md index 8fa71ad88dc..0d07182bc98 100644 --- a/src/lib/dialog/dialog.md +++ b/src/lib/dialog/dialog.md @@ -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. diff --git a/src/lib/form-field/form-field.md b/src/lib/form-field/form-field.md index c28164137e0..dc602c759c6 100644 --- a/src/lib/form-field/form-field.md +++ b/src/lib/form-field/form-field.md @@ -38,7 +38,7 @@ present in the form field control. It can also be set to `auto` to restore the d -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`.