docs-bug(dialog): Suggest using strong types for MAT_DIALOG_DATA
See original GitHub issueDocumentation Feedback
In the Sharing data with Dialog component section, the type of MAT_DIALOG_DATA
in the described example is set to any
. Given that it is encouraged to use strongly typing in Angular projects, I would suggest to use the following interface for the example:
interface DialogData {
name: string;
}
export class YourDialog {
constructor(@Inject(MAT_DIALOG_DATA) public data: DialogData) { }
}
Affected documentation page: https://material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component
I would love to work on a related PR if you find it useful. 🙏
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
NullInjectorError: No provider for InjectionToken MatDialogData
in my case, I imported the directives MatDialogModule, MAT_DIALOG_DATA and MatDialogRef import { MatDialogModule, MAT_DIALOG_DATA ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Verifying them is somewhat convoluted since the docs site is in a separate repo. You can rely on the Markdown preview.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.