diff --git a/docs/site/components/language-switcher/language-switcher-directive.js b/docs/site/components/language-switcher/language-switcher-directive.js index 3a704d8dda9..0b71df65c66 100644 --- a/docs/site/components/language-switcher/language-switcher-directive.js +++ b/docs/site/components/language-switcher/language-switcher-directive.js @@ -6,10 +6,29 @@ angular return { templateUrl: 'site/components/language-switcher/language-switcher.html', transclude: true, - link: function($scope, elem, attrs) { $scope.extraLinks = $parse(attrs.extraLinks)($scope); $scope.showNavDropdown = false; + }, + controller: function($scope, $attrs) { + this.useApiDocs = $parse($attrs.useApiDocs)($scope); + } + }; + }) + .directive('apiDocs', function() { + 'use strict'; + + return { + require: '^languageSwitcher', + restrict: 'A', + scope: { + href: '@', + apiDocs: '@' + }, + link: function (scope, elem, attrs, switcher) { + if (switcher.useApiDocs) { + elem.attr('href', scope.href + scope.apiDocs); + } } }; }); diff --git a/docs/site/components/language-switcher/language-switcher.html b/docs/site/components/language-switcher/language-switcher.html index 927e2e7d3ea..c04be040b82 100644 --- a/docs/site/components/language-switcher/language-switcher.html +++ b/docs/site/components/language-switcher/language-switcher.html @@ -80,19 +80,19 @@