You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to initialise routes from pages that are defined in a database collection. So I made the following:
FlowRouter.wait();
Meteor.subscribe("pages", {
onReady: function () {
const allPages = Pages.find().fetch();
for (var i = 0; i < allPages.length; i++) {
FlowRouter.route('/'+allPages[i].slug, {
name: allPages[i].name,
action: function(params, queryParams) {
}
});
};
}
});
FlowRouter.initialize();
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: