Skip to content

Commit 6333b96

Browse files
bampakoajelbourn
authored andcommitted
docs: add types in injection token examples (#20818)
Use strong typing for injection token examples. Closes #20759 (cherry picked from commit d5eb389)
1 parent 1c39b72 commit 6333b96

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/material/bottom-sheet/bottom-sheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {MAT_BOTTOM_SHEET_DATA} from '@angular/material/bottom-sheet';
4545
template: 'passed in {{ data.names }}',
4646
})
4747
export class HobbitSheet {
48-
constructor(@Inject(MAT_BOTTOM_SHEET_DATA) public data: any) { }
48+
constructor(@Inject(MAT_BOTTOM_SHEET_DATA) public data: {names: string[]}) { }
4949
}
5050
```
5151

src/material/dialog/dialog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ import {MAT_DIALOG_DATA} from '@angular/material/dialog';
102102
template: 'passed in {{ data.name }}',
103103
})
104104
export class YourDialog {
105-
constructor(@Inject(MAT_DIALOG_DATA) public data: any) { }
105+
constructor(@Inject(MAT_DIALOG_DATA) public data: {name: string}) { }
106106
}
107107
```
108108

src/material/snack-bar/snack-bar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import {MAT_SNACK_BAR_DATA} from '@angular/material/snack-bar';
6969
template: 'passed in {{ data }}',
7070
})
7171
export class MessageArchivedComponent {
72-
constructor(@Inject(MAT_SNACK_BAR_DATA) public data: any) { }
72+
constructor(@Inject(MAT_SNACK_BAR_DATA) public data: string) { }
7373
}
7474
```
7575

0 commit comments

Comments
 (0)