Components: Opening an MdDialog with a TemplateRef that uses `md-dialog-close` throws "no provider for MdDialogRef"

Created on 29 Jun 2017  路  4Comments  路  Source: angular/components

Proposal:

Provide MdDialogRef even when we pass a TemplateRef.

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 throws no 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.

P3 has pr

Most helpful comment

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.

All 4 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?

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theunreal picture theunreal  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

Hiblton picture Hiblton  路  3Comments

shlomiassaf picture shlomiassaf  路  3Comments

alanpurple picture alanpurple  路  3Comments