Open NvdB31 opened 7 years ago
@cloudrocketsoftware put FlowRouter.initialize();
inside the onReady
callback, at the end.
FlowRouter.wait(); Meteor.subscribe("pages", { onReady() { Pages.find().forEach(function (page) { FlowRouter.route('/' + page.slug, { name: page.name, action: function (params, queryParams) { } }); }); FlowRouter.initialize(); } });
I'm looking to initialise routes from pages that are defined in a database collection. So I made the following:
Then when I open up the browser console I can see that the FlowRouter._routes object contains a nice array with all the routes from the collection. However when I visit the routes I get an error: 'There is no route for the path: routename'
Any ideas why this is happening? It seems that it cannot initialise routes from within a loop so it seems?