Skip to content

Instantly share code, notes, and snippets.

@n370
Last active January 5, 2016 02:44
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 n370/e289d9265714e5978e2a to your computer and use it in GitHub Desktop.
Save n370/e289d9265714e5978e2a to your computer and use it in GitHub Desktop.
Issue with FlowRouter
FlowRouter.route('/product/:id', {
name: 'product',
action(params) {
let product = Products.findOne({_id: new Mongo.ObjectID(params.id)});
/**
* Will return undefined after a browser refresh, although
* sometimes it seems to work fine. However, if activated
* by FlowRouter.go('product', {id: "a valid id string"})
* will return a collection document as expected
*/
console.log(product);
BlazeLayout.render("mainLayout", {main: "product"});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment