Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

md-dialog: pass additional content #2707

Closed
alexciesielski opened this issue Jan 18, 2017 · 4 comments
Closed

md-dialog: pass additional content #2707

alexciesielski opened this issue Jan 18, 2017 · 4 comments

Comments

@alexciesielski
Copy link

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

I would like to pass a string to the dialog when opening it with this.dialog.open(...) to be displayed in the dialog itself.

What is the current behavior?

I can't pass additional data directly to the dialog.

What is the use-case or motivation for changing an existing behavior?

I can pass data using an additional service, but that seems overkill when I just want to pass a string.

Currently, you can set options for the dialog, it would be nice to have a data field in there to pass additional content along.

@codef0rmer
Copy link

codef0rmer commented Jan 19, 2017

@ciesielskico You should grab the componentInstance to pass the data in:

let dialogRef = this.dialog.open(MyComponent);
dialogRef.componentInstance['myProperty'] = "Value"

@alexciesielski
Copy link
Author

alexciesielski commented Jan 21, 2017

Looks hacky but I'll try this, thanks.

Still, I think there should be a more elegant and straightforward way to do the same.

@crisbeto
Copy link
Member

Closing as a duplicate of #2181 which has a pending PR.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants