Documentation is unclear about how to get data into a Dialog.
See original GitHub issueBug, feature request, or proposal:
Documentation bug.
What is the expected behavior?
When I use the MdDialog service to open a dialog with some component, I’d love to be able to pass some configuration into that component.
What is the current behavior?
The dialogRef
exposes componentInstance
, which allows me to set properties / call functions on the component after construction, however I’m unsure if this is the recommended approach since it is not mentioned in the docs.
What are the steps to reproduce?
Read the docs at https://github.com/angular/material2/blob/master/src/lib/dialog/README.md, and notice the example uses a “static” dialog.
What is the use-case or motivation for changing an existing behavior?
It would improve the documentation and reduce the number of future issues.
Which versions of Angular, Material, OS, browsers are affected?
Latest /all
Is there anything else we should know?
I can submit a PR for improved documentation of an answer from this threads provides sufficient information!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:10 (2 by maintainers)
Top Results From Across the Web
How to pass data to dialog of angular material 2 - Stack Overflow
1) add the import statement import { MatDialog} from '@angular/material'; · 2) add the property to the constructor params · 3) define the...
Read more >How to pass data to a MatDialog | nerd.vision
As you can see, passing data to a dialog component is as simple as adding a data key to the options parameter of...
Read more >Angular Material Dialog: A Complete Example
In this post, we are going to go through a complete example of how to build a custom dialog using the Angular Material...
Read more >Use a Dialog Model to Manage Ambiguous Responses
This document assumes you are familiar with the concepts around interaction models (intents, slots, and sample utterances) and dialog models (required slots, ...
Read more >5 Essential UX Rules for Dialog Design | by Nick Babich
Dialogs are effective user interface element when you design and use them right. They can help your users complete reach their goals faster...
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
I figured it out from another post: use this when opening
use this in the modal
I’ve added this to my todo list.