Backbone.js 视图主干中的传递模型

Backbone.js 视图主干中的传递模型,backbone.js,Backbone.js,嗨,我的路由器中有这个功能: home: function() { var attore= new Attore(); var page = new ListPostView({ model: this.attore }); this.changePage(page); }, 阿托尔的模型是: var Attore = Backbone.Model.extend({ defaults: { "nome": "caesar salad", "cognome": "r

嗨,我的路由器中有这个功能:

  home: function() {
 var attore= new Attore();
 var page = new ListPostView({
 model: this.attore
 });
    this.changePage(page);

  },
阿托尔的模型是:

var Attore = Backbone.Model.extend({

defaults: {
"nome":  "caesar salad",
"cognome": "ravioli"

},



});


 return Attore;
 });
但是发生了一个错误,告诉我视图中的模型未定义:

var ListPostView = Backbone.View.extend({

    tagName: "ul",
    id: "list",

    template: Handlebars.compile(template),

    initialize: function () {
        console.log(attore);
      this.model.bind("reset", this.render, this);
    },

    render: function (eventName) {
      $(this.el).empty();
      _.each(this.model.models, function (ad) {
        $(this.el).append(new SinglePostView({
          model: ad
        }).render().el);
      }, this);
      return this;
    }
  });

return ListPostView;

 });  

可能是因为您试图传递
此.attore
,但您从未将您的型号分配给路由器。您可能打算直接传入模型
var page=newlistpostview({model:attore})