I'm using kendo spa support in 2013.3.1119
If I want to have optional query parameters, it is not clear how to do that. I've got something to work, but it feels broken, or inconsistent.
See fiddle.
I'm trying to support a route with no :id param, but has optional query params, like this:
I could only make this work by having a dummy first parameter since "undefined" is passed as arg1:
That seems like a bug.
I found if I have an :id param in my route, like:
Then the optional query params are implicitly passed in the second argument. This is how I'd expect it to work (with or without an :id param).
In summary, should I be trying to take advantage of the automatic/implicit second argument that contains the query params? Or should I be including the (?:params) in my route url?
Am I missing something? Is there a bug here?
Thanks
If I want to have optional query parameters, it is not clear how to do that. I've got something to work, but it feels broken, or inconsistent.
See fiddle.
I'm trying to support a route with no :id param, but has optional query params, like this:
router.route("/images(?:params)", function (params) {
I could only make this work by having a dummy first parameter since "undefined" is passed as arg1:
router.route("/images(?:params)", function (dummy, params) {
That seems like a bug.
I found if I have an :id param in my route, like:
router.route("/images/:id", function(id, params) {
Then the optional query params are implicitly passed in the second argument. This is how I'd expect it to work (with or without an :id param).
In summary, should I be trying to take advantage of the automatic/implicit second argument that contains the query params? Or should I be including the (?:params) in my route url?
Am I missing something? Is there a bug here?
Thanks