Skip to content

Commit 8361915

Browse files
committed
Merge branch 'krmarien-master'
2 parents 78eba97 + fe5b80d commit 8361915

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"grunt-contrib-concat": "",
88
"grunt-karma": "",
99
"karma": "",
10-
"karma-jasmine": "",
10+
"karma-jasmine": "0.1.5",
1111
"karma-phantomjs-launcher": "",
1212
"karma-junit-reporter": "",
1313
"grunt-git-describe": ""

src/route-segment.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,17 @@ mod.provider( '$routeSegment',
118118

119119
/**
120120
* The shorthand for $routeProvider.when() method with specified route name.
121-
* @param {string} route Route URL, e.g. '/foo/bar'
121+
* @param {string} path Route URL, e.g. '/foo/bar'
122122
* @param {string} name Fully qualified route name, e.g. 'foo.bar'
123+
* @param {Object} route Mapping information to be assigned to $route.current on route match.
123124
*/
124-
$routeSegmentProvider.when = function(route, name) {
125-
$routeProvider.when(route, {segment: name});
126-
segmentRoutes[name] = route;
125+
$routeSegmentProvider.when = function(path, name, route) {
126+
if (route == undefined)
127+
route = {};
128+
route.segment = name;
129+
130+
$routeProvider.when(path, route);
131+
segmentRoutes[name] = path;
127132
return this;
128133
};
129134

0 commit comments

Comments
 (0)