Last active
February 22, 2021 22:38
-
-
Save armorpreston/9ace9b0bee0e4c5e1bf65da48bbf93fd to your computer and use it in GitHub Desktop.
Simple Modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="btn my-4" | |
[modalId]="'simple-modal'" | |
[modalTrigger]="simpleExample" | |
(activated$)="activeModal = $event" | |
(completed$)="onComplete($event)"> | |
<!-- [modalId], (activated$), and (completed$) are optional --> | |
show modal | |
</button> | |
<ng-template #simpleExample let-reject="dismiss" let-resolve=close> | |
<modal> | |
<modal-header title="Modal Title" [dismiss]="d"></modal-header> | |
<modal-body> | |
<span class="code-block--inline mb-3">modalId = `{{activeModal}}`</span> | |
<p> | |
I could / should be my own component! Reload the page to see me auto-open. | |
</p> | |
<p> | |
<button class="btn btn-link" (click)="reject()">Cancel</button> | |
<button class="btn btn-primary" (click)="resolve(101)">Proceed</button> | |
</p> | |
</modal-body> | |
</modal> | |
</ng-template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment