您好,我想推送 TypeScript 中现有的新键值对,我尝试了以下步骤,但没有发生任何情况,也没有错误,请帮助
profile = {"RouteID":"B76F77922EF83A4EE04024921F591A6F","Name":"3019998FALCON","rName":"KILGORE REMOVED"}
let newvalue = "jzket"
profile["userID"] = newvalue
Run Code Online (Sandbox Code Playgroud) 我不想使用“ |异步管道”,因为我不想获取每个组件的数据。我的转换功能如下:
transform(key: string, ...args) {
this.storage.get("dictionary").then((dict) => {
var translated = dict[key] || "noResource";
console.log("key = "+key + ", value = "+translated);
return translated;
});
}
Run Code Online (Sandbox Code Playgroud)
我可以获取键和值,但无法显示值。我尝试了ngZone但没有工作。