aurelia / router

A powerful client-side router.
MIT License
120 stars 115 forks source link

NavigationInstruction does not add a path separator when the fragment is empty #506

Open firelizzard18 opened 7 years ago

firelizzard18 commented 7 years ago

I'm submitting a bug report

Current behavior: I have an app. One of the app's routes is first, which becomes #/first. first has routes, one of which is second, which becomes #/firstsecond. This fails with 'route not found'.

Expected/desired behavior: Instead of #/firstsecond, it should be #/first/second.

Fix: Line 173 of navigation-instruction:

 if (nonEmptyRoute) {
-    fragment = nonEmptyRoute.route;
+    fragment = `/${nonEmptyRoute.route}`;
 }
EisenbergEffect commented 7 years ago

Would you be willing to submit a PR for this fix? We'd love to have you as a contributor :)

On Jul 25, 2017 6:57 PM, "Ethan Reesor" notifications@github.com wrote:

I'm submitting a bug report

-

Library Version: master

JSPM Version JSPM 0.16.32

Current behavior: I have an app. One of the app's routes is first, which becomes #/first. first has routes, one of which is second, which becomes #/firstsecond. This fails with 'route not found'.

Expected/desired behavior: Instead of #/firstsecond, it should be #/first/second.

Fix: Line 173 of navigation-instruction https://github.com/aurelia/router/blob/master/src/navigation-instruction.js#L173 :

if (nonEmptyRoute) {- fragment = nonEmptyRoute.route;+ fragment = /${nonEmptyRoute.route}; }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aurelia/router/issues/506, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIBnVGJ7pm7uQh4Xsckyj-WF3taT-r0ks5sRp0ggaJpZM4OjVV4 .

firelizzard18 commented 7 years ago

Gotta talk to my boss :/