Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m.route's defaultRoute blows away existing hash #57

Closed
sdemjanenko opened this issue Apr 21, 2014 · 1 comment
Closed

m.route's defaultRoute blows away existing hash #57

sdemjanenko opened this issue Apr 21, 2014 · 1 comment

Comments

@sdemjanenko
Copy link

I have the config:

m.route(document.getElementById("nodesList"), "/", {
  "/": MKI.Pages.NodesList,
  "/nodes/:nodeID": MKI.Pages.NodeDetails
});
m.route.mode = "hash";

When I try to deep link to a page (from outside the app) it initializes to the defaultRoute instead of rendering the deep linked view. Once I am in the app I can switch to the deep link.

@sdemjanenko
Copy link
Author

I think I figured it out.

m.route.mode = "hash";
m.route(document.getElementById("nodesList"), "/", {
  "/": MKI.Pages.NodesList,
  "/nodes/:nodeID": MKI.Pages.NodeDetails
});

I had to set the mode before I called .route. That makes sense. I didn't really think about it when I originally wrote the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant