export interface _ProjectBudgetHistories {
createdBy?: string ;
id?: number;
budgetYear? : number ;
logicalFrameworkId? : number ;
projectId?: number ;
amount?: number ;
mooe?: number ;
co?: number;
}
pbHistories : _ProjectBudgetHistories;
let co =500;
let mooe =1000;
this.pbHistories.co = co;
this.pbHistories.mooe = mooe;
console.log(this.pbHistories);
这是错误TypeError:无法设置未定义的属性'co' TypeError:无法设置未定义的属性“ mooe”
=== >>如何仅更新mooe和co ???
答案 0 :(得分:0)
初始化您的财产
pbHistories : _ProjectBudgetHistories = {};