diff --git a/public/_includes/_hero.jade b/public/_includes/_hero.jade index 0323e2737c..725e0e8985 100644 --- a/public/_includes/_hero.jade +++ b/public/_includes/_hero.jade @@ -13,8 +13,12 @@ if current.path[4] && current.path[3] == 'api' - var textFormat = 'is-standard-case' +if current.path.indexOf('cheatsheet') > 0 || current.path[current.path.length-2] === 'api' + - var base = current.path[4] ? '../guide' : './guide'; + - var ngVersion = '(v2.X.Y)'; + header.hero.background-sky - h1(class="hero-title #{textFormat}") #{headerTitle} + h1(class="hero-title #{textFormat}") #{headerTitle} !{ngVersion} if useBadges if stability diff --git a/public/docs/dart/latest/_data.json b/public/docs/dart/latest/_data.json index 502a4d2af9..68eb4ab948 100644 --- a/public/docs/dart/latest/_data.json +++ b/public/docs/dart/latest/_data.json @@ -49,9 +49,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", + "title": "Cheat Sheet", "subtitle": "Dart", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/dart/latest/guide/_data.json b/public/docs/dart/latest/guide/_data.json index 23f05e1019..b9048fd240 100644 --- a/public/docs/dart/latest/guide/_data.json +++ b/public/docs/dart/latest/guide/_data.json @@ -69,8 +69,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", + "title": "Cheat Sheet", + "subtitle": "Dart", "nextable": true, "basics": true }, diff --git a/public/docs/js/latest/_data.json b/public/docs/js/latest/_data.json index 18ed3ed0bd..b55503dd4e 100644 --- a/public/docs/js/latest/_data.json +++ b/public/docs/js/latest/_data.json @@ -41,9 +41,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", + "title": "Cheat Sheet", "subtitle": "JavaScript", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/js/latest/guide/_data.json b/public/docs/js/latest/guide/_data.json index b3b33214c3..7bc784f771 100644 --- a/public/docs/js/latest/guide/_data.json +++ b/public/docs/js/latest/guide/_data.json @@ -51,8 +51,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", + "title": "Cheat Sheet", + "subtitle": "JavaScript", "nextable": true, "basics": true }, diff --git a/public/docs/ts/latest/_data.json b/public/docs/ts/latest/_data.json index 207e4dce54..a74eff6a53 100644 --- a/public/docs/ts/latest/_data.json +++ b/public/docs/ts/latest/_data.json @@ -49,9 +49,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", + "title": "Cheat Sheet", "subtitle": "TypeScript", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", "reference": false }, diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json index b17b4aff45..6b9677117a 100644 --- a/public/docs/ts/latest/guide/_data.json +++ b/public/docs/ts/latest/guide/_data.json @@ -78,8 +78,8 @@ }, "cheatsheet": { - "title": "Angular Cheat Sheet", - "intro": "A quick guide to Angular syntax. (Content is provisional and may change.)", + "title": "Cheat Sheet", + "subtitle": "TypeScript", "nextable": true, "basics": true }, diff --git a/public/resources/js/directives/cheatsheet.js b/public/resources/js/directives/cheatsheet.js index 6b2ba9d9fe..e941e5efa7 100644 --- a/public/resources/js/directives/cheatsheet.js +++ b/public/resources/js/directives/cheatsheet.js @@ -1,21 +1,23 @@ angularIO.directive('ngioCheatsheet', function() { return { + restrict: 'E', + scope: {}, controllerAs: '$ctrl', controller: function($http, $attrs, $sce) { var $ctrl = this; $http.get($attrs.src).then(function(response) { - $ctrl.currentEnvironment = response.data.currentEnvironment; - $ctrl.version = response.data.version; - $ctrl.sections = response.data.sections; + if ($attrs.hasOwnProperty('versionOnly')) { + $ctrl.version = response.data.version.raw; + } else { + $ctrl.sections = response.data.sections; + } }); $ctrl.getSafeHtml = function(html) { return $sce.trustAsHtml(html); }; }, template: - '

Angular for {{$ctrl.currentEnvironment}} Cheat Sheet (v{{ $ctrl.version.raw }})

' + - '
' + - '
Loading Cheatsheet...
\n' + + '{{$ctrl.version}}' + '\n' + '\n' + ' \n' +
{{section.name}}