Skip to content

Dialog design #131

@tb

Description

@tb

I have recently replaced md2-dialog with mdl-dialog. It however creates a lot of extra effort compared to usage of md2-dialog which did not require service / vcRef and I was able to use it with just the directive.

This is example how I was able to use it to build a Confirm component:

<mdl-dialog #confirmDialog>
  <div class="mdl-dialog__content">{{ message }}</div>
  <div class="mdl-dialog__actions">
    <button type="button" class="mdl-button" (click)="action.emit()">Yes</button>
    <button type="button" class="mdl-button close" (click)="confirmDialog.close()">No</button>
  </div>
</md2-dialog>

<div (click)="confirmDialog.show()">
  <ng-content></ng-content>
</div>

I have used this component by wrapping remove icon like this:

<confirm
    title="Remove Post"
    message="You are you sure?"
    [skip]="!post.id"
    (action)="remove.emit()">
  <mdl-button mdl-button-type="icon">
    <mdl-icon>cancel</mdl-icon>
  </mdl-button>
</confirm>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions