【发布时间】:2018-04-14 12:18:11
【问题描述】:
我将“TotalUnits”值发送到对话框并在那里更新值。我想读回“dialog.result”中的“TotalUnits”值。有些我没有看到更新的价值。请问有什么帮助吗?
主要组件:
AllocationDialog(data: any) {
const dialog: DialogRef = this.component.dialogService.open({
title: ' Allocations',
content: AllocationComponent,
actions: [
{ text: 'Save', primary: true, data },
],
width: 500,
height: 500
});
dialog.result.subscribe((dialogResult) => {
if (dialogResult instanceof DialogCloseResult) {
console.log('close');
} else {
console.log('action', dialogResult);
}
});
const allocationsInfo = dialog.content.instance;
allocationsInfo.TotalUnits = data.TotalUnits;
}
AllocationComponent - 对话框:
@Input() public TotalUnits: number;
<input kendoTextBox [(ngModel)]="TotalUnits" />
【问题讨论】: