I'm converting my backbone example to now extend Marionette. I'm finding it difficult understand achieving the same thing with templates. Let me explain.
This is how I use to render a template
In view render function:
campaign.fetch({
var template = _.template(campaignTemplate, {campaign: campaign});
that.$el.html(template);
With backbone.marionette I'm not sure how to do the same thing, this is what I have tried without any joy:
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
*What I'm I doing wrong? underscore is not even there! *