Skip to content

Commit

Permalink
Merge branch 'krmarien-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
artch committed Apr 30, 2015
2 parents 78eba97 + fe5b80d commit 8361915
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"grunt-contrib-concat": "",
"grunt-karma": "",
"karma": "",
"karma-jasmine": "",
"karma-jasmine": "0.1.5",
"karma-phantomjs-launcher": "",
"karma-junit-reporter": "",
"grunt-git-describe": ""
Expand Down
13 changes: 9 additions & 4 deletions src/route-segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,17 @@ mod.provider( '$routeSegment',

/**
* The shorthand for $routeProvider.when() method with specified route name.
* @param {string} route Route URL, e.g. '/foo/bar'
* @param {string} path Route URL, e.g. '/foo/bar'
* @param {string} name Fully qualified route name, e.g. 'foo.bar'
* @param {Object} route Mapping information to be assigned to $route.current on route match.
*/
$routeSegmentProvider.when = function(route, name) {
$routeProvider.when(route, {segment: name});
segmentRoutes[name] = route;
$routeSegmentProvider.when = function(path, name, route) {
if (route == undefined)
route = {};
route.segment = name;

$routeProvider.when(path, route);
segmentRoutes[name] = path;
return this;
};

Expand Down

0 comments on commit 8361915

Please sign in to comment.