Skip to content

Commit

Permalink
docs(cdk/dialog): CDK Dialog docs missing explanation on how to acces…
Browse files Browse the repository at this point in the history
…s 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)
  • Loading branch information
MichelleRetroRabbit authored and crisbeto committed Jul 9, 2024
1 parent 2b8b6ef commit 0413a67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cdk/dialog/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ If you're using a `TemplateRef` for your dialog content, the data is available i
</ng-template>
```

If you're using a `TemplateRef` and need to access the `DialogRef`, you can use the following:

```html
<ng-template let-data let-dialogRef="dialogRef">
Hello, {{data.name}}
</ng-template>
```

<!-- example(cdk-dialog-data) -->

### Accessibility
Expand Down

0 comments on commit 0413a67

Please sign in to comment.