Skip to content

Commit ccc33ad

Browse files
committed
docs(versions): remove the trailing slash in URLs when switch versions
Because `https://docs.angularjs.org/api/` can handler the trailing slash, but `https://code.angularjs.org/1.2.24/docs/api` can not. Fix angular#9043
1 parent 4899e78 commit ccc33ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/app/src/versions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ angular.module('versions', [])
55
$scope.docs_version = NG_VERSIONS[0];
66

77
$scope.jumpToDocsVersion = function(version) {
8-
var currentPagePath = $location.path();
8+
var currentPagePath = $location.path().replace(/\/$/, '');
99

1010
// TODO: We need to do some munging of the path for different versions of the API...
11-
11+
1212

1313
$window.location = version.docsUrl + currentPagePath;
1414
};
15-
}]);
15+
}]);

0 commit comments

Comments
 (0)