I have a Flow-Router group definitions similar to:
var myRouteGroup = FlowRouter.group({
name: "myGroupName",
prefix: "/myPrefix",
// Using arbitrary element to pass group wide defaults
defaultGroupSettings: {item1: "value1", item2: "value2"};
});
I than define a route in that group:
myRouteGroup.route("/home",{
name: "myRoute",
triggersEnter: [ /*...*/ ],
action: function () {
// Get the arbitrary settings object from group definition
var settings = this.group.options.defaultGroupSettings;
// Override one of the settings element's value
settings.item1 = "new value";
// Render the route, and pass the modified settings
BlazeLayout.render("layoutTemplate", settings);
}
});
The problem I am trying to solve. The above code overwrites the defaultGroupSettings.item1
for all subsequent routes attached to the group after this route is called. It's as if the local override either overwrites the group settings object, or the group settings object is not called again if subsequent routes are in the same group.
It is a problem with scope of the data? Or is it a problem of Flow-Router not referring to the group definition again if the new route being called is a part of the same group, and just recycling the existing previous route group object? Or maybe something I haven't thought of.