Update mithril.route.md
Set the `m.route.mode="hash"` first, then define the `m.route`
This commit is contained in:
parent
0ee2d7f200
commit
5608b5ce4c
1 changed files with 3 additions and 3 deletions
|
|
@ -51,13 +51,13 @@ var dashboard = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//setup routes to start w/ the `#` symbol
|
||||||
|
m.route.mode = "hash";
|
||||||
|
|
||||||
//define a route
|
//define a route
|
||||||
m.route(document.body, "/dashboard/johndoe", {
|
m.route(document.body, "/dashboard/johndoe", {
|
||||||
"/dashboard/:userID": dashboard
|
"/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:
|
This redirects to the URL `http://server/#/dashboard/johndoe` and yields:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue