如何更改/修改/刷新我的List<JavaScriptError> jsErrors = JavaScriptError.ReadErrors(driver);
AngularJS?
我的localstorage
内容是localstorage
json:
object
但是,如果我修改这样的唯一键:
//data content: {Id:1,Name:"Juanito"}
localStorageService.set("MyObj",data);
console.log(localStorageService.get("MyObj"));
//SHOW object JSON {Id:1,Name:"Juanito"}
它不起作用。我该如何解决这个问题?
答案 0 :(得分:1)
尝试检索,然后更新并重新设置:
var data = {id: 123}
localStorageService.set("MyObj",data);
var dataFromLS = localStorageService.get("MyObj");
dataFromLS.id = 456;
localStorageService.set("MyObj",data);
console.log(localStorageService.get("MyObj"));
答案 1 :(得分:0)