Skip to content

Instantly share code, notes, and snippets.

@fwielstra
Created June 13, 2011 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwielstra/1022576 to your computer and use it in GitHub Desktop.
Save fwielstra/1022576 to your computer and use it in GitHub Desktop.
Sammy.js - Full example
(function($) {
var app = $.sammy('#main', function() {
this.use('Template');
this.get('#/', function(context) {
this.load('thread')
.then( function(threads) {
$.each(threads, function(i, thread) {
context.render('templates/thread.template', {thread : thread})
.appendTo(context.$element());
});
});
});
});
$( function() {
app.run('#/');
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment