Make m.route.param() return all params #737

This commit is contained in:
Jakob Dam Jensen 2015-08-18 20:44:58 +02:00
parent 7a5980631e
commit caf1138c31
2 changed files with 24 additions and 0 deletions

View file

@ -958,6 +958,9 @@ var m = (function app(window, undefined) {
};
m.route.param = function(key) {
if (!routeParams) throw new Error("You must call m.route(element, defaultRoute, routes) before calling m.route.param()");
if( !key ){
return routeParams;
}
return routeParams[key];
};
m.route.mode = "search";