小编Geo*_*ght的帖子

无法循环骨干集合

似乎我无法遍历骨干集合.我已经在几个主题中看过这个主题,但这些解决方案都没有帮助.

render:function () {
        this.$el.html(this.template(this.model.attributes));
        var that = this;


        console.log(this.projects.models);
        _.each(this.projects.models, function(model) { console.log(model); });

        return this;
    }
Run Code Online (Sandbox Code Playgroud)

从这个我的控制台只显示数组[2]我希望看到每个模型.有谁知道我在这里做错了什么?

backbone.js underscore.js backbone.js-collections

2
推荐指数
1
解决办法
5082
查看次数