如何检查材料对话框在角度4中关闭

时间:2018-11-01 13:38:29

标签: angular dialog

如何检查材料对话框是否关闭?对话框完全关闭时,我必须运行代码。我使用过.afterClosed();方法,但仍在IE中以某种方式在对话框完全关闭之前运行我的自定义代码。

返回值的方法:

confirmComplete(location:string):Observable<boolean>{
    return this.dialogUtil.infoMessage(`You are currently filling this order with inverntory from ${location}.
Click "Confirm" to complete the picking process or "Cancel" to change the inventory location.`,
      `Confirmation`,
      DialogUtil.MessageStyle.Pre,
      DialogUtil.PromptStyle.ConfirmCancel
    ).afterClosed();
  }

以下是我使用上述方法的方式:

this.confirmComplete(this.userLocation.displayName).subscribe(ok => ok ? this.process() : this.userStore.focusLocationDropDown(true));

在对话框完全关闭之前会以某种方式调用this.userStore.focusLocationDropDown(true),而我仅在IE11中遇到此问题,它在chrome中工作正常。

0 个答案:

没有答案