我有一个名为dropdown的对象,带有键值对的对象。我想更新名为dropdowns的对象。如何更新对象。请帮助我。
dropdowns: any = {};
dropdowns={
clientCode: ["ALDR","NIKE"],
carrierCode: ["XYZ","ABC","DEF","GHI"],
invoiceCount: [123,456,789]
}
我想制作clientCode:[“LMN”,“OPQ”,“RST”,“UVW”] 如何更新对象。
答案 0 :(得分:0)
dropdowns.clientCode = ["LMN","OPQ","RST","UVW"];
答案 1 :(得分:0)
您只需要使用“。”(点)运算符访问您的下拉列表对象,然后选择要更新的键,就像您说的“clientCode”那样:
//objectname.key = newvalue; -- syntax
dropdown.clientCode = ["LMN","OPQ","RST","UVW"];