Reputation: 21
I have routes:
routes: {
"": "main",
"!/order/:id": "order",
"!/order": "order"
},
Then I access for example to http://mysite.ru/#!/order/21
. But my URL changes to: http://mysite.ru/#!/order/
The number 21 is hiding. How to save this number in my URL?
Upvotes: 0
Views: 98
Reputation: 15982
You can simplify your router by making the :id
parameter optional, since your callback is the same for both order routes.
routes: {
"": "main",
"!/order(/:id)": "order",
},
Upvotes: 2
Reputation: 2331
I think it is cascading. Try to set the general order routing first:
routes: {
"": "main",
"!/order": "order",
"!/order/:id": "order"
},
Upvotes: 3