此Plunk捕获从服务启动的Kendo对话框中的事件行为。我需要能够将业务逻辑应用于结果(用户输入)并决定是否应取消事件,但“外部”代码始终在“内部”代码之前运行。该对话框不是文档建议的模态。
public showConfirmation() {
const dialog: DialogRef = this.dialogService.open({
title: "Please confirm",
content: "Are you sure?",
actions: [
{ text: "No" },
{ text: "Yes", primary: true }
],
width: 450,
height: 200,
minWidth: 250
}).result.subscribe((result) => {
if (result instanceof DialogCloseResult) {
console.log("close");
} else {
console.log("action", result);
//setTimeout(2000);
let date = Date.now()
console.log('inside', date);
}
this.result = JSON.stringify(result);
});
let date = Date.now()
console.log('outside' + date);
}