我正在将我的主干示例转换为现在扩展 Marionette。我发现很难理解用模板实现同样的事情。让我解释。
这就是我用来渲染模板的方式
在视图渲染功能中:
campaign.fetch({
 var template = _.template(campaignTemplate, {campaign: campaign});
 that.$el.html(template);  
使用backbone.marionette,我不确定如何做同样的事情,这是我尝试过的,没有任何喜悦:
  var campaginView = Backbone.Marionette.ItemView.extend({
        initialize: function (options) {
            // campaign id passed from the URL Route
            this.campaign_id = options.id;
        },
        model: new CampaginModel({
            id: this.campaign_id
        }),
        template: campaignTemplate({
           campaign: this.model.fetch() 
        }),
    }); // end campagin view
*我做错了什么?下划线甚至不存在!*