Slide 44
Slide 44 text
Templates can be loaded in using the RequireJS text plugin
External templates
define([
'jquery',
'underscore',
'backbone',
'text!templates/mytemplate.html'
], function($, _, Backbone, myTemplate){
var TodoView = Backbone.View.extend({
//... is a list tag.
tagName: "li",
// Cache the template function for a single item.
template: _.template(myTemplate),