1
+ {
2
+ "Angular Controller" : {
3
+ "prefix" : " ngcontroller" ,
4
+ "body" : [
5
+ " (function() {" ,
6
+ " 'use strict';" ,
7
+ " " ,
8
+ " \t angular" ,
9
+ " \t\t .module('${Module}')" ,
10
+ " \t\t .controller('${Controller}Controller', ${Controller}Controller);" ,
11
+ " " ,
12
+ " \t ${Controller}Controller.$inject = ['${dependency1}'];" ,
13
+ " \t function ${Controller}Controller(${dependency1}) {" ,
14
+ " \t\t var vm = this;" ,
15
+ " \t\t $0" ,
16
+ " " ,
17
+ " \t\t activate();" ,
18
+ " " ,
19
+ " \t\t ////////////////" ,
20
+ " " ,
21
+ " \t\t function activate() { }" ,
22
+ " \t }" ,
23
+ " })();"
24
+ ],
25
+ "description" : " Angular 1 controller"
26
+ },
27
+ "Angular Service" : {
28
+ "prefix" : " ngservice" ,
29
+ "body" : [
30
+ " (function() {" ,
31
+ " 'use strict';" ,
32
+ " " ,
33
+ " \t angular" ,
34
+ " \t\t .module('${Module}')" ,
35
+ " \t\t .service('${Service}', ${Service});" ,
36
+ " " ,
37
+ " \t ${Service}.$inject = ['${dependency1}'];" ,
38
+ " \t function ${Service}(${dependency1}) {" ,
39
+ " \t\t this.${exposedFn} = ${exposedFn};" ,
40
+ " \t\t $0" ,
41
+ " \t\t ////////////////" ,
42
+ " \t\t function ${exposedFn}() { }" ,
43
+ " \t }" ,
44
+ " })();"
45
+ ],
46
+ "description" : " Angular 1 service"
47
+ },
48
+ "Angular Factory" : {
49
+ "prefix" : " ngfactory" ,
50
+ "body" : [
51
+ " (function() {" ,
52
+ " 'use strict';" ,
53
+ " " ,
54
+ " \t angular" ,
55
+ " \t\t .module('${Module}')" ,
56
+ " \t\t .factory('${Service}', ${Service});" ,
57
+ " " ,
58
+ " \t ${Service}.$inject = ['${dependency1}'];" ,
59
+ " \t function ${Service}(${dependency1}) {" ,
60
+ " \t\t var service = {" ,
61
+ " \t\t\t ${exposedFn}:${exposedFn}" ,
62
+ " \t\t };" ,
63
+ " \t\t $0" ,
64
+ " \t\t return service;" ,
65
+ " " ,
66
+ " \t\t ////////////////" ,
67
+ " \t\t function ${exposedFn}() { }" ,
68
+ " \t }" ,
69
+ " })();"
70
+ ],
71
+ "description" : " Angular 1 factory"
72
+ },
73
+ "Angular Directive" : {
74
+ "prefix" : " ngdirective" ,
75
+ "body" : [
76
+ " (function() {" ,
77
+ " \t 'use strict';" ,
78
+ " " ,
79
+ " \t angular" ,
80
+ " \t\t .module('${Module}')" ,
81
+ " \t\t .factory('${Directive}', ${Directive});" ,
82
+ " " ,
83
+ " \t ${Directive}.$inject = ['${dependency1}'];" ,
84
+ " \t function ${Directive}(${dependency1}) {" ,
85
+ " \t\t // Usage:" ,
86
+ " \t\t //" ,
87
+ " \t\t // Creates:" ,
88
+ " \t\t //" ,
89
+ " \t\t var directive = {" ,
90
+ " \t\t bindToController: true," ,
91
+ " \t\t controller: ${Controller}Controller," ,
92
+ " \t\t controllerAs: '${vm}'," ,
93
+ " \t\t link: link," ,
94
+ " \t\t restrict: 'A'," ,
95
+ " \t\t scope: {" ,
96
+ " \t\t }" ,
97
+ " \t\t };" ,
98
+ " \t\t return directive;" ,
99
+ " \t\t " ,
100
+ " \t\t function link(scope, element, attrs) {" ,
101
+ " \t\t }" ,
102
+ " \t }" ,
103
+ " \t /* @ngInject */" ,
104
+ " \t function ${Controller}Controller () {" ,
105
+ " \t\t $0" ,
106
+ " \t }" ,
107
+ " })();"
108
+ ],
109
+ "description" : " Angular 1 directive"
110
+ },
111
+ "Angular Module" : {
112
+ "prefix" : " ngmodule" ,
113
+ "body" : [
114
+ " (function() {" ,
115
+ " \t 'use strict';" ,
116
+ " " ,
117
+ " \t angular.module('${module}', [" ,
118
+ " \t\t $0" ,
119
+ " \t ]);" ,
120
+ " })();"
121
+ ],
122
+ "description" : " Angular 1 module"
123
+ }
124
+ }
0 commit comments