Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9824c59

Browse files
committed
refactor(ngRoute): do not unnecessarily return originalPath in routeToRegExp
1 parent 506fe73 commit 9824c59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ngRoute/route.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ function $RouteProvider() {
225225
}
226226
routes[path] = angular.extend(
227227
routeCopy,
228+
{originalPath: path},
228229
path && routeToRegExp(path, routeCopy)
229230
);
230231

@@ -235,7 +236,7 @@ function $RouteProvider() {
235236
: path + '/';
236237

237238
routes[redirectPath] = angular.extend(
238-
{redirectTo: path},
239+
{originalPath: path, redirectTo: path},
239240
routeToRegExp(redirectPath, routeCopy)
240241
);
241242
}

src/routeToRegExp.js

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ function routeToRegExp(pathOrUrl, opts) {
3636
}
3737

3838
return {
39-
originalPath: pathOrUrl,
4039
keys: keys,
4140
regexp: new RegExp(
4241
'^' + pattern + '(?:[?#]|$)',

0 commit comments

Comments
 (0)