Skip to content

Instantly share code, notes, and snippets.

@hojberg
Created December 9, 2009 22:26
Show Gist options
  • Save hojberg/252896 to your computer and use it in GitHub Desktop.
Save hojberg/252896 to your computer and use it in GitHub Desktop.
// Simplified example
App.Controllers.Sales = Object.create(App.Controllers.Master, {
all: function () {
// Find all method on Sale initiates a callback when data has returnes
App.Models.Sale.findAll(function () {
// render method on $ initiate a callback when the template has been loaded in the dom
$('contentarea').render("sales/all", function (sales) {
// Pure template autoRender method finds some id and auto loops over and array
$('#id-of-a-list-of-sales').autoRender(sales);
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment