aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-snippets/UltiSnips/javascript-angular.snippets
blob: 91b593165591cb7ddf835913e98618043db12a04 (plain)
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
priority -50

snippet iti "it (js, inject)" b
it('${1:description}', inject(function($2) {
	$0
}));
endsnippet

snippet befi "before each (js, inject)" b
beforeEach(inject(function($1) {
	$0
}));
endsnippet

snippet aconf "angular config" i
config(function($1) {
	$0
});
endsnippet

snippet acont "angular controller" i
controller('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet

snippet aconts "angular controller with scope" i
controller('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet

snippet adir "angular directive" i
directive('${1}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	return {
		restrict: '${3:EA}',
		link: function(scope, element, attrs) {
			${0}
		}
	};
}]);
endsnippet

snippet adirs "angular directive with scope" i
directive('${1}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	return {
		restrict: '${3:EA}',
		link: function(scope, element, attrs) {
			${0}
		}
	};
}]);
endsnippet

snippet afact "angular factory" i
factory('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet

snippet afacts "angular factory with scope" i
factory('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet

snippet aserv "angular service" i
service('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet

snippet aservs "angular service" i
service('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
	$0
}]);
endsnippet