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