假设我可以从 javascript 控制台获得以下结果:
var ls = new Backbone.LocalStorage("items");
ls; // {"name":"items","records":["1244f588-be3d-c493-5c86-b2abb997af82"]}
我应该如何Backbone.Collection
从Backbone.LocalStorage
?
PS:
集合看起来像
[
{
"title":"test",
"completed":false,
"order":1,
"id":"1244f588-be3d-c493-5c86-b2abb997af82"
},
{
"title":"test2",
"completed":false,
"order":2,
"id":"8a8658b9-b636-eac3-4c54-03c279a73c2d"
}
]