Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 19, 2014 00:15
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/dc4b9f5e6b0b72917243 to your computer and use it in GitHub Desktop.
Save devdays/dc4b9f5e6b0b72917243 to your computer and use it in GitHub Desktop.
Single Page App - Load Product Data
this.get('#/products/:id', function (context) {
var param = context.params['id'];
var products = context.items.products;
if (!products[param]) {
return context.notFound();
}
context.partial('Templates/productDetail.html', products[param]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment