-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Opening an MdDialog with a TemplateRef that uses md-dialog-close
throws "no provider for MdDialogRef"
#5412
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
Comments
This is a known issue. It's because we can't set a custom injector on a template ref (since it's already instantiated). I've discussed a potential solution with @jelbourn, but haven't gotten around to implementing it yet. |
Hi, Any news on that? Thanks :) |
Hello any news on this? |
…ialogs Previously the `matDialogClose`, `matDialogTitle` etc. directives would only work correctly inside component dialogs, because using DI to get the dialog ref doesn't work inside template dialogs. These changes add a fallback that finds the dialog ref based on the id of the closest dialog container. Fixes angular#5412.
…ialogs Previously the `matDialogClose`, `matDialogTitle` etc. directives would only work correctly inside component dialogs, because using DI to get the dialog ref doesn't work inside template dialogs. These changes add a fallback that finds the dialog ref based on the id of the closest dialog container. Fixes angular#5412.
…ialogs Previously the `matDialogClose`, `matDialogTitle` etc. directives would only work correctly inside component dialogs, because using DI to get the dialog ref doesn't work inside template dialogs. These changes add a fallback that finds the dialog ref based on the id of the closest dialog container. Fixes #5412.
…ialogs Previously the `matDialogClose`, `matDialogTitle` etc. directives would only work correctly inside component dialogs, because using DI to get the dialog ref doesn't work inside template dialogs. These changes add a fallback that finds the dialog ref based on the id of the closest dialog container. Fixes angular#5412.
…ialogs (#9379) Previously the `matDialogClose`, `matDialogTitle` etc. directives would only work correctly inside component dialogs, because using DI to get the dialog ref doesn't work inside template dialogs. These changes add a fallback that finds the dialog ref based on the id of the closest dialog container. Fixes #5412.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Proposal:
Provide
MdDialogRef
even when we pass aTemplateRef
.What is the current behaviour?
With the current setup if we pass a TemplateRef to MdDialog, there is no way to use
md-dialog-close
directive as it throwsno provider for MdDialogRef
as it requires it.What is the expected behaviour?
It would be great if it works with a
TemplateRef
but if that's not possible, then could you please add a brief warning to the docs?What are the steps to reproduce?
I can provide a plunkr if needed.
The text was updated successfully, but these errors were encountered: