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

19,113

Solution 1

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

Solution 2

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

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

Share:
19,113
Ramesh Rajendran
Author by

Ramesh Rajendran

Technologies : HTML CSS Asp.Net MVC Web Api C# Angular 1-7 Unit Test (Front End & Back End) I am currently working in L&T . Read my blog C# DotNet Solutions.

Updated on June 23, 2022

Comments

  • Ramesh Rajendran
    Ramesh Rajendran almost 2 years

    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.