使用backbone的Model的集合的时候使用
self.fetch({
success : function(Collection,resp){
console.log(self.length) // 0
console.log(resp) //[{},{}] 有数据
}
});
无法把数据添加到集合中。

接口我使用的是nodejs的的接口get后数据是正常的

代码我放到了git上,地址为:
后端:https://github.com/LuDongWei/demo/tree/master/node-address
前端:https://github.com/LuDongWei/demo/tree/master/backbone
在学习mvc的途中很纠结,希望帮助
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
闭关修行中......