首页 > 解决方案 > 获取窗口参考并检测组件角度中的窗口关闭 2+

问题描述

    <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>

此代码位于组件 html 文件中,并通过提交表单打开子窗口。如何跟踪关闭窗口事件?

标签: javascripthtmlangular

解决方案


推荐阅读