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
If I visit http://yourdomain.com/#home/product/features, the correct route was picked and onRoute function will be triggered. However the path is actually wrong. It will be home/aboutus/contactus/email instead of home/:menu/:id.
I think Marionette uses the below undercore function to find the path var routePath = _.invert(this.getOption('appRoutes'))[routeName];
This could cause problem if multiple routes points to the same method.
Any thought is appreicated.
The text was updated successfully, but these errors were encountered:
_.invert(this.getOption('appRoutes')) creates an object with the inverted keys and values. If routes object contains duplicate values, subsequent values overwrite property assignments of previous values.
In your case the result will be:
Let's say we have multiple routes pointing to the same controller action
If I visit http://yourdomain.com/#home/product/features, the correct route was picked and
onRoute
function will be triggered. However thepath
is actually wrong. It will behome/aboutus/contactus/email
instead ofhome/:menu/:id
.I think Marionette uses the below undercore function to find the path
var routePath = _.invert(this.getOption('appRoutes'))[routeName];
This could cause problem if multiple routes points to the same method.
Any thought is appreicated.
The text was updated successfully, but these errors were encountered: