I'm interested in using crossroads.js, but unfortunately I can't use it as is, because crossroads seems to throw away the names of the URL parameters. This, IMHO is a fundamental flaw.
I can't define my route handlers like that, because I need to forward the URL parameters (e.g. id and date) without knowing what they are. So I need something like this:
crossroads.addRoute('/news/{id}/:date:', function(params) {
goToState(stateHandlingThisRoute, params); //params === { id : <some id>, data : <some date> }
});
Only a state named stateHandlingThisRoute knows what to expect in params; at the level where I add the handler, I don't know!
So, if the above is not possible, Crossroads can't be used in a larger architecture where the URL parameters are still an abstract concept. Maybe I missed something that makes this abstract use possible. If so, please let me know! If not, this would need to be fixed IMO, to make crossroads applicable as a routing library in more complex routing systems.
Hello,
I'm interested in using crossroads.js, but unfortunately I can't use it as is, because crossroads seems to throw away the names of the URL parameters. This, IMHO is a fundamental flaw.
Example:
This is how you are suppose to use Crossroads.js:
I can't define my route handlers like that, because I need to forward the URL parameters (e.g. id and date) without knowing what they are. So I need something like this:
Only a state named
stateHandlingThisRoute
knows what to expect in params; at the level where I add the handler, I don't know!So, if the above is not possible, Crossroads can't be used in a larger architecture where the URL parameters are still an abstract concept. Maybe I missed something that makes this abstract use possible. If so, please let me know! If not, this would need to be fixed IMO, to make crossroads applicable as a routing library in more complex routing systems.
-- Freddy Snijder