From ccc33ad1d8002883ff6f5ceb5271e345a79a5330 Mon Sep 17 00:00:00 2001 From: bolasblack Date: Fri, 12 Sep 2014 16:41:36 +0800 Subject: [PATCH] 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 #9043 --- docs/app/src/versions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/app/src/versions.js b/docs/app/src/versions.js index 701f41d38cb1..d2f6f217078f 100644 --- a/docs/app/src/versions.js +++ b/docs/app/src/versions.js @@ -5,11 +5,11 @@ angular.module('versions', []) $scope.docs_version = NG_VERSIONS[0]; $scope.jumpToDocsVersion = function(version) { - var currentPagePath = $location.path(); + var currentPagePath = $location.path().replace(/\/$/, ''); // TODO: We need to do some munging of the path for different versions of the API... - + $window.location = version.docsUrl + currentPagePath; }; -}]); \ No newline at end of file +}]);