Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call angular function when click p-dialog close(X) button?

How to call angular function when click p-dialog close(X) button?

I have searched and just tried this (onHide)="cancel()" . But it's not working. Kindly share your solutions.

I know we can use a close/cancel button to hide the popup. But in my scenario I want to call an event when clicking the (X) button click.

like image 612
Ramesh Rajendran Avatar asked May 08 '17 12:05

Ramesh Rajendran


2 Answers

Actually (onHide)="cancel()" works fine according to this Plunkr.

like image 50
hiper2d Avatar answered Sep 25 '22 07:09

hiper2d


Try: (click)="cancel()" instead.

I had the same error but I solved it by using the click method. Grettings :)

like image 45
Martin Jair Diaz Rodriguez Avatar answered Sep 25 '22 07:09

Martin Jair Diaz Rodriguez