Created
August 8, 2013 14:03
-
-
Save xero/6184844 to your computer and use it in GitHub Desktop.
load a handlebars template via ajax then use it as a backbone view
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
$.ajax({ | |
url: 'ui/tpl/login.handlebars', | |
context: this, | |
cache: true, | |
success: function(data) { | |
var tpl = Handlebars.compile(data); | |
this.$el.html(tpl(this.model.toJSON())); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment