0

我有一个代码可以在打开的窗口上创建一个新用户。所以我想在window.close上触发一个偶数。谁能帮我解决这个问题。

我的代码是这样的

this.authService.postWithoutEncript('callSiteRegUrl', this.sitesData.value, '', true).subscribe(response => {
if (response['status'] === 200) {
const redirectLink = response['msg']; // This link will open on new window
let newwindow = window.open(redirectLink, '_blank', 'toolbar=yes,scrollbars=yes,resizable=yes,top=0,left=0,width=1000,height=600');
} else {
console.log('error message');
}
}, (err: HttpErrorResponse) => {
});

上面的代码将在新窗口上打开一个链接。如何在关闭打开的窗口时调用函数?我想在单击关闭按钮时调用一个函数

4

0 回答 0