Created
March 3, 2011 14:37
-
-
Save topherfangio/852855 to your computer and use it in GitHub Desktop.
TemplateView with Handlebars
This file contains 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
MyApp.TestView = SC.ScrollView.extend({ | |
render: function(context) { | |
// Note: Do not use the word 'view' as a key in the following data object, | |
// as SproutCore and/or Handlebars will not display it properly | |
// (probably because it's a helper function) | |
var data = { somevar:"SproutCore" }; | |
var template = SC.TEMPLATES['test'](data); | |
context.push( template ); | |
}, | |
update: function(jquery) { | |
// do whatever you need to for somevar... | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment