Created
November 24, 2012 01:03
-
-
Save AdamBrodzinski/4137894 to your computer and use it in GitHub Desktop.
Backbone Template Helpers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// precompiled backbone underscore template helper | |
var getTemplate = function (id) { | |
return _.template( $('#'+ id).html() ); | |
}; | |
// doesn't call underscore | |
var uncompiledTemplate = function (id) { | |
return $('#'+ id).html(); | |
}; | |
var myView = Backbone.View.extend({ | |
template : getTemplate('myTemplateID') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment