-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
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>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels