This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree 8 files changed +22
-19
lines changed
8 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 13
13
if current .path [4 ] && current .path [3 ] == ' api'
14
14
- var textFormat = ' is-standard-case'
15
15
16
+ if current .path .indexOf (' cheatsheet' ) > 0 || current .path [current .path .length - 2 ] === ' api'
17
+ - var base = current .path [4 ] ? ' ../guide' : ' ./guide' ;
18
+ - var ngVersion = ' (v<ngio-cheatsheet src="' + base + ' /cheatsheet.json" version-only>2.X.Y</ngio-cheatsheet>)' ;
19
+
16
20
header.hero.background-sky
17
- h1( class ="hero-title #{textFormat} " ) #{headerTitle}
21
+ h1( class ="hero-title #{textFormat} " ) #{headerTitle} !{ngVersion}
18
22
19
23
if useBadges
20
24
if stability
Original file line number Diff line number Diff line change 49
49
},
50
50
51
51
"cheatsheet" : {
52
- "title" : " Angular Cheat Sheet" ,
52
+ "title" : " Cheat Sheet" ,
53
53
"subtitle" : " Dart" ,
54
- "intro" : " A quick guide to Angular syntax. (Content is provisional and may change.)" ,
55
54
"reference" : false
56
55
},
57
56
Original file line number Diff line number Diff line change 69
69
},
70
70
71
71
"cheatsheet" : {
72
- "title" : " Angular Cheat Sheet" ,
73
- "intro " : " A quick guide to Angular syntax. (Content is provisional and may change.) " ,
72
+ "title" : " Cheat Sheet" ,
73
+ "subtitle " : " Dart " ,
74
74
"nextable" : true ,
75
75
"basics" : true
76
76
},
Original file line number Diff line number Diff line change 41
41
},
42
42
43
43
"cheatsheet" : {
44
- "title" : " Angular Cheat Sheet" ,
44
+ "title" : " Cheat Sheet" ,
45
45
"subtitle" : " JavaScript" ,
46
- "intro" : " A quick guide to Angular syntax. (Content is provisional and may change.)" ,
47
46
"reference" : false
48
47
},
49
48
Original file line number Diff line number Diff line change 51
51
},
52
52
53
53
"cheatsheet" : {
54
- "title" : " Angular Cheat Sheet" ,
55
- "intro " : " A quick guide to Angular syntax. (Content is provisional and may change.) " ,
54
+ "title" : " Cheat Sheet" ,
55
+ "subtitle " : " JavaScript " ,
56
56
"nextable" : true ,
57
57
"basics" : true
58
58
},
Original file line number Diff line number Diff line change 49
49
},
50
50
51
51
"cheatsheet" : {
52
- "title" : " Angular Cheat Sheet" ,
52
+ "title" : " Cheat Sheet" ,
53
53
"subtitle" : " TypeScript" ,
54
- "intro" : " A quick guide to Angular syntax. (Content is provisional and may change.)" ,
55
54
"reference" : false
56
55
},
57
56
Original file line number Diff line number Diff line change 78
78
},
79
79
80
80
"cheatsheet" : {
81
- "title" : " Angular Cheat Sheet" ,
82
- "intro " : " A quick guide to Angular syntax. (Content is provisional and may change.) " ,
81
+ "title" : " Cheat Sheet" ,
82
+ "subtitle " : " TypeScript " ,
83
83
"nextable" : true ,
84
84
"basics" : true
85
85
},
Original file line number Diff line number Diff line change 1
1
angularIO . directive ( 'ngioCheatsheet' , function ( ) {
2
2
return {
3
+ restrict : 'E' ,
4
+ scope : { } ,
3
5
controllerAs : '$ctrl' ,
4
6
controller : function ( $http , $attrs , $sce ) {
5
7
var $ctrl = this ;
6
8
$http . get ( $attrs . src ) . then ( function ( response ) {
7
- $ctrl . currentEnvironment = response . data . currentEnvironment ;
8
- $ctrl . version = response . data . version ;
9
- $ctrl . sections = response . data . sections ;
9
+ if ( $attrs . hasOwnProperty ( 'versionOnly' ) ) {
10
+ $ctrl . version = response . data . version . raw ;
11
+ } else {
12
+ $ctrl . sections = response . data . sections ;
13
+ }
10
14
} ) ;
11
15
$ctrl . getSafeHtml = function ( html ) {
12
16
return $sce . trustAsHtml ( html ) ;
13
17
} ;
14
18
} ,
15
19
template :
16
- '<h2>Angular for {{$ctrl.currentEnvironment}} Cheat Sheet (v{{ $ctrl.version.raw }})</h2>' +
17
- '<br>' +
18
- '<div ng-if="!$ctrl.sections">Loading Cheatsheet...</div>\n' +
20
+ '<span ng-if="$ctrl.version">{{$ctrl.version}}</span>' +
19
21
'<table ng-repeat="section in $ctrl.sections" ng-cloak>\n' +
20
22
'<tr>\n' +
21
23
' <th>{{section.name}}</th>\n' +
You can’t perform that action at this time.
0 commit comments