refactor(ngRoute): do not unnecessarily return originalPath in routeToRegExp
This commit is contained in:
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ function routeToRegExp(pathOrUrl, opts) {
|
||||
}
|
||||
|
||||
return {
|
||||
originalPath: pathOrUrl,
|
||||
keys: keys,
|
||||
regexp: new RegExp(
|
||||
'^' + pattern + '(?:[?#]|$)',
|
||||
|
||||
Reference in New Issue
Block a user