Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Using pre-compiled templates with Backbone.Marionette, require.js and the tpl template plugin
define(function (require, exports, module) {
var ns = require('namespace'),
Backbone = require('use!backbone'),
Marionette = require('use!marionette'),
// the tpl require.js plugin extends the text plugin to compile the text into an underscore template
// The require.js optimizer will minify and concatenate them to your apps single JS
ordersViewTpl = require('tpl!templates/orders.html');
var Orders = ns.module();
Orders.Model = Backbone.Model.extend({});
Orders.Collection = Backbone.Collection.extend({
url: '/orders',
model: Orders.Model
});
Orders.Views.Details = Backbone.Marionette.ItemView.extend({
tagName: 'div',
// turns out, the signature of renderHtml matches a compiled template, so I can just
// override it with the template - simple and easy
renderHtml: orderDetailTpl
});
return Orders;
});
@KevM

Thanks I think this will help me out as I am using the same plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.