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

Ramesh Rajendran picture Ramesh Rajendran · May 8, 2017 · Viewed 20.1k times · Source

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.

Answer

hiper2d picture hiper2d · May 8, 2017

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