Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 19, 2014 01:25
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 devdays/ac1daf88515050e5880f to your computer and use it in GitHub Desktop.
Save devdays/ac1daf88515050e5880f to your computer and use it in GitHub Desktop.
Single Page App - Sammy Route Code
this.get('#/products', function (context) {
var products = context.items;
// clear out the $element in this case '#content'
context.app.swap('');
// Uses the plugin to transform the template with the products data
// then appends it to the $element
context.render('templates/4-products.html', products)
.appendTo(context.$element());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment