Reputation: 57206
I want to have the hash url like this,
site.com/#/page/edit/about-us/
so I set the router in my backbone,
routes: {
'/page/edit/:url/': 'renderDynamicPage',
},
renderDynamicPage: function (url) {
console.log(url);
},
but nothing comes out.
it should be about-us
any ideas why and how I can get around to this?
Upvotes: 0
Views: 712
Reputation:
Backbone.js documentation says
Note that you'll want to avoid using a leading slash
try
routes: {
'page/edit/:url': 'renderDynamicPage',
},
renderDynamicPage: function (url) {
console.log(url);
},
Upvotes: 1