Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

md-dialog and directives #3897

@lrondanini

Description

@lrondanini

Hi all,

I apologize if this is an old question but I cannot find a solution. I'm trying to include the code for a dialog inside a directive. In other words:

$mdDialog.show({ ..... template: '<my-directive></my-directive>', ..... })

and, of course, "my directive" would be

<md-dialog>.....</md-dialog>

The problem is that with this approach I get an error from angular-material.js at runtime (I believe it's trying to access the root node for the dialog finding the directive). The only solution is to have the full skeleton of the dialog outside "my-directive" and directly imported in $mdDialog.show(). FYI, I tried transclude=true but it's not working either.

In case you are wondering the reason for this mess, I'm trying to avoid controllers. Any suggestion?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions