Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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