Skip to content

Commit 3ca40ae

Browse files
MichelleRetroRabbitcrisbeto
authored andcommitted
docs(cdk/dialog): CDK Dialog docs missing explanation on how to access dialogRef when using a TemplateRef (#29381)
* fix(cdk/dialog): CDK Dialog docs missing explanation on how to access dialogRef when using a TemplateRef Updated the dialog in the cdk to add an example on accessing the dialogRef when using TemplateRef Fixes #26193 * fix(cdk/dialog): CDK Dialog docs missing explanation on how to access dialogRef when using a TemplateRef Updated wording used to explain the example. Fixes #26193 (cherry picked from commit 3d1ca53)
1 parent fc6beea commit 3ca40ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cdk/dialog/dialog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ If you're using a `TemplateRef` for your dialog content, the data is available i
159159
</ng-template>
160160
```
161161

162+
If you're using a `TemplateRef` and need to access the `DialogRef`, you can use the following:
163+
164+
```html
165+
<ng-template let-data let-dialogRef="dialogRef">
166+
Hello, {{data.name}}
167+
</ng-template>
168+
```
169+
162170
<!-- example(cdk-dialog-data) -->
163171

164172
### Accessibility

0 commit comments

Comments
 (0)