Skip to content

Instantly share code, notes, and snippets.

@tomdale
tomdale / gist:1134558
Created August 9, 2011 16:53
Load remote Handlebars templates
jQuery.get('/templates/foo.handlebars', function(data) {
var template = SC.Handlebars.compile(data);
SC.TEMPLATES['foo'] = template;
})
reloadRecords: function() {
SC.Request.getUrl('/yoururl').json()
.notify(this, '_didRetrieve')
.send();
},
_didRetrieve:function(response) {
if(!SC.ok(response)) {
console.log('Unable to retrieve record');