Skip to content

Instantly share code, notes, and snippets.

@willkessler
Last active December 22, 2015 16:58
Show Gist options
  • Save willkessler/6502419 to your computer and use it in GitHub Desktop.
Save willkessler/6502419 to your computer and use it in GitHub Desktop.
iron-router controller
// productView.html
<template name="productView">
{{title}}
</template>
// routes.js
Router.map(function () {
this.route('home', {
path: '/'
});
this.route('product', {
controller: 'productViewController'
});
});
productViewController = RouteController.extend({
template: 'productView',
data: function() {
return {
product: Products.find({title:'SWITCH'})
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment