Question

When using the can.Control.route documented here, I can not manage to set default parameters values as it is possible when using the classical declarative way as follow :

can.route("content/:type", {type: "videos" });

Is there a way to set the default value of a router parameter when using the route Control ?

Thanks for assistance.

Was it helpful?

Solution

You should be able to define the route in your control and then set the default value as described above:

can.Control.extend({
  'content/:type route': function() {
    //
  }
});

can.route("content/:type", { type: "videos" });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top