1
    <form *ngIf="data.yesAsLink" id="myForm" ngNoForm [action]=action method="post" 
    target="pay" onsubmit="window.open('about:blank','pay','width=1050,height=860');"
    style="display: inline; margin-left: 20px;">
        <input type="hidden" name="ClientId" value="ExelaRON" />
        <input type="hidden" name="Param" [value]=input />
        <button type="submit" (click)="onYesClick(this)" 
            mat-button class="btn primary-btn" value="Submit"
            style="font-size: 14px;">Pay now</button>
      </form>

this code is in component html file and opening child window by submitting form. how to track close window event on this?

Mahesh
  • 11
  • 2
  • Need to call function on window close. – Mahesh Jul 20 '21 at 11:48
  • If the closing window is a component, you can use ngOnDestroy which is an Angular lifecycle. – Qiimiia Jul 20 '21 at 11:51
  • Does this answer your question? [Is there any lifecycle hook like window.onbeforeunload in Angular2?](https://stackoverflow.com/questions/36763141/is-there-any-lifecycle-hook-like-window-onbeforeunload-in-angular2) – Aviad P. Jul 20 '21 at 11:52

0 Answers0