I have a working application using Backbone 0.5.3 that no longer works using the 0.9.2 backbone.
I found that Router.navigate () for some reason does not call my route.
Here is my router:
var Router = Backbone.Router.extend({
routes: {
'/mypage': 'mypage',
},
mypage: function() {
}
});
Manual route calling also works just as well:
Router.mypage()
I also tried to rewrite the base .navigate method to debug my application ...
var Router = Backbone.Router.extend({
routes: {
'/mypage': 'mypage',
},
navigate: function(fragment, options) {
console.log("navigate called");
Backbone.history.navigate(fragment, options);
},
mypage: function() {
}
});
... it seems .navigate is being invoked, but ...
Backbone.history.navigate(fragment, options);
... just doesn't call the route.
I am using PushState, here is my initial call:
Backbone.history.start({
root: '/',
pushState: true,
silent: true
});
Already tried this without root and silent options - without success.
Again: this works using Backbone 0.5.3.
Thanks to everyone who left an answer!
Achim