Update mithril.route.md

Set the `m.route.mode="hash"` first, then define the `m.route`
This commit is contained in:
franknova 2014-09-12 13:24:17 +08:00
parent 0ee2d7f200
commit 5608b5ce4c

View file

@ -51,13 +51,13 @@ var dashboard = {
}
}
//setup routes to start w/ the `#` symbol
m.route.mode = "hash";
//define a route
m.route(document.body, "/dashboard/johndoe", {
"/dashboard/:userID": dashboard
});
//setup routes to start w/ the `#` symbol
m.route.mode = "hash";
```
This redirects to the URL `http://server/#/dashboard/johndoe` and yields: