Skip to content

Opening an MdDialog with a TemplateRef that uses md-dialog-close throws "no provider for MdDialogRef"  #5412

Closed

Description

@alex321

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.

Activity

  1. crisbeto commented on Jun 29, 2017

    @crisbeto
    Member

    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.

  2. self-assigned this
    on Jun 29, 2017
  3. christophechevalier commented on Sep 26, 2017

    @christophechevalier

    Hi,

    Any news on that?

    Thanks :)

  4. pitops commented on Oct 28, 2017

    @pitops

    Hello any news on this?

  5. added
    P3
    on Nov 28, 2017
  6. added a commit that references this issue on Jan 13, 2018
    4eb16c2
  7. added a commit that references this issue on Jan 16, 2018
    d94efbe
  8. added a commit that references this issue on Jan 21, 2018
    9d42c9a
  9. added a commit that references this issue on Jan 23, 2018
    7d7d225
  10. added a commit that references this issue on Jan 24, 2018
    99b768e
  11. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  12. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions