Skip to content

Commit 5dbc618

Browse files
crisbetojelbourn
authored andcommitted
docs(dialog): add note about pass data to a template dialog (#16700)
Based on the discussion in #16665, these changes add a note to the dialog docs about how to access the `data` inside a template dialog.
1 parent 4c8956b commit 5dbc618

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/material/dialog/dialog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ export class YourDialog {
107107
}
108108
```
109109

110+
Note that if you're using a template dialog (one that was opened with a `TemplateRef`), the data
111+
will be available implicitly in the template:
112+
113+
```html
114+
<ng-template let-data>
115+
Hello, {{data.name}}
116+
</ng-template>
117+
```
118+
110119
<!-- example(dialog-data) -->
111120

112121
### Dialog content

0 commit comments

Comments
 (0)