Reputation: 266
I am using a prime-ng component p-dialog. I created a MyModal component for modal.i want to open this MyModal component on click event like uib-modal. Is any easy way to do like uib-modal?
Upvotes: 3
Views: 864
Reputation: 5574
Add your MyModal component tag to the embedding component template and toggle it using *ngIf
.
<my-modal *ngIf="show" name="{{ name }}"></my-modal>
<button (click)="show = true">show dialog</button>
Here's a working StackBlitz example: https://stackblitz.com/edit/angular-m9bphb
Upvotes: 1