Answer the question
In order to leave comments, you need to log in
How to configure route in CanJS so that links are without #?
How to configure route in CanJS so that links are without #!?
Now: example.com/#!/firstPage
Needed: example.com/firstPage
AngularJS uses $locationProvider.html5Mode(true);
EmberJS uses App.Router.reopen({ location: 'auto' });
Can't find similar functionality for CanJS...
Answer the question
In order to leave comments, you need to log in
It seems to me that there is no such
piece of code from routes.js
...
bindings: {
hashchange: {
paramsMatcher: paramsMatcher,
querySeparator: "&",
// don't greedily match slashes in routing rules
matchSlashes: false,
bind: function () {
can.bind.call(window, 'hashchange', setState);
},
unbind: function () {
can.unbind.call(window, 'hashchange', setState);
},
// Gets the part of the url we are determinging the route from.
// For hashbased routing, it's everything after the #, for
// pushState it's configurable
matchingPartOfURL: function () {
return location.href.split(/#!?/)[1] || "";
},
// gets called with the serialized can.route data after a route has changed
// returns what the url has been updated to (for matching purposes)
setURL: function (path) {
location.hash = "#!" + path;
return path;
},
root: "#!"
}
},
...
As it is not, just include the pushstate plugin canjs.com/docs/can.route.pushstate.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question