refactor(ngRoute): do not unnecessarily return originalPath in routeToRegExp

This commit is contained in:
George Kalpakas
2018-08-21 14:58:56 +03:00
parent 506fe73a4a
commit 9824c59dca
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -225,6 +225,7 @@ function $RouteProvider() {
}
routes[path] = angular.extend(
routeCopy,
{originalPath: path},
path && routeToRegExp(path, routeCopy)
);
@@ -235,7 +236,7 @@ function $RouteProvider() {
: path + '/';
routes[redirectPath] = angular.extend(
{redirectTo: path},
{originalPath: path, redirectTo: path},
routeToRegExp(redirectPath, routeCopy)
);
}
-1
View File
@@ -36,7 +36,6 @@ function routeToRegExp(pathOrUrl, opts) {
}
return {
originalPath: pathOrUrl,
keys: keys,
regexp: new RegExp(
'^' + pattern + '(?:[?#]|$)',