Created
December 19, 2014 00:15
-
-
Save devdays/dc4b9f5e6b0b72917243 to your computer and use it in GitHub Desktop.
Single Page App - Load Product Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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