I want to close this dialog box when I click on button.
<p-dialog [(visible)]="displayFact" [modal]="true" [style]="[{width: '50%'}]" [baseZIndex]="1000" [draggable]="false" [resizable]="false" [closable]='true'> <div class="card rounded"> <div>....</div> <a class="btn btn-primary w-25 mx-auto rounded mb-3" (click)= "closeDialog()">Close</a> </div> </p-dialog>
You can try the following to achieve this.
closeDialog(){ this.displayFact = false }
API
Visible boolean false Specifies the visibility of the dialog.
https://www.primefaces.org/primeng/showcase/#/dialog
1.4m articles
1.4m replys
5 comments
56.9k users