【发布时间】:2018-08-12 14:20:14
【问题描述】:
错误消息“'{'itemType': string;'qty': string;'time': string;}' 类型的参数不能分配给'openInventory[]' 类型的参数。 类型 '{ 'itemType': string; 中缺少属性 'length' “数量”:字符串; '时间':字符串; }'。”
片段
openInventorys: AngularFireList<openInventory[]>;
openInventory: AngularFireObject<any>;
addOpenInventory(org: any, type:string, qty:string) {
this.openInventorys = this.af.list('/inventory/' + org+ '/openInventory') ;
var openInventoryData = { 'itemType': type, 'qty': qty, 'time': moment().format('YYYY-MM-DD HH:mm') };
this.openInventorys.push(openInventoryData);
}
interface openInventory {
$key?: string;
itemType?: string;
qty?: string;
time?: string;
}
【问题讨论】:
标签: angular angularfire5