Skip to content

Commit de7bbdd

Browse files
committed
use $0 for last postion in snippets
1 parent 1503f6b commit de7bbdd

File tree

4 files changed

+60
-59
lines changed

4 files changed

+60
-59
lines changed

snippets/coffee/angular_coffee.snippets

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,114 +3,115 @@
33
# You can change the controller name and parameters
44
snippet ngc
55
${1:controllerName} = (${2:scope}, ${3:injectables}) ->
6-
${4}
6+
${0}
77
# angular.foreach loop
88
snippet ngfor
99
angular.forEach ${1:iterateOver}, (value, key) ->
10-
${2}
10+
${0}
1111
## Module Based Snippets
1212
# A new angular module without a config function
1313
snippet ngm
1414
angular.module '${1:moduleName}', [${2:moduleDependencies}]
15-
${3}
15+
${0}
1616
# A new angular module without a config function and a variable assignment
1717
snippet ngma
1818
${1:moduleName} = angular.module '$1', [${2:moduleDeps}]
19-
${3}
19+
${0}
2020
# A new angular module with a config function
2121
snippet ngmc
2222
${1:moduleName} = angular.module('$1', [${2:moduleDeps}], (${3:configDeps}) ->
23-
${4}
23+
${0}
2424
)
2525
# A factory in a module
2626
snippet ngmfa
2727
factory '${1:factoryName}', (${2:dependencies}) ->
28-
${3}
28+
${0}
2929
# Define an Angular Module Service to be attached to a previously defined module
3030
# You can change the service name and service injectables
3131
snippet ngms
3232
service '${1:serviceName}', (${2:injectables}) ->
33-
${3}
33+
${0}
3434
# Define an Angular Module Filter to be attached to a previously defined module
3535
# You can change the filter name
3636
snippet ngmfi
3737
filter '${1:filterName}', (${2:injectables}) ->
3838
(input, ${3:args}) ->
39-
${4}
39+
${0}
4040
## Route Based Snippets
4141
# Defines a when condition of an AngularJS route
4242
snippet ngrw
4343
$routeProvider.when '${1:url}',
4444
templateUrl: '${2:templateUrl}'
4545
controller: '${3:controller}'
46-
${4}
46+
${0}
4747
# Defines a when condition of an AngularJS route with the resolve block
4848
snippet ngrwr
4949
$routeProvider.when '${1:url}',
5050
templateUrl: '${2:templateUrl}'
5151
controller: '${3:controller}'
5252
resolve:
5353
${4}
54-
${5}
54+
${0}
5555
# Defines an otherwise condition of an AngularJS route
5656
snippet ngro
5757
$routeProvider.otherwise redirectTo: '${1:url}'
58-
${2}
58+
${0}
5959
## Scope Related Snippets
6060
# Define a new $scope'd function (usually inside an AngularJS Controller)
6161
# You can change the function name and arguments
6262
snippet $f
6363
$scope.${1:functionName} = (${2:args}) ->
64-
${3}
64+
${0}
6565
# Defines a new $scope'd variable inside an AngularJS controller
6666
snippet $v
6767
$scope.${1:variable} = ${2:value}
68-
${3}
68+
${0}
6969
# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments
7070
snippet $va
7171
$scope.${1:variable} = ${2:variable}
72-
${3}
72+
${0}
7373
# Define a $watch for an expression
7474
# You can change the expression to be watched
7575
snippet $w
7676
$scope.$watch '${1:watchExpr}', (newValue, oldValue) ->
77-
${2}
77+
${0}
7878
# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller
7979
# You can change the event name to listen on
8080
snippet $on
8181
$scope.$on '${1:eventName}', (event, ${2:args}) ->
82-
${3}
82+
${0}
8383
# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function
8484
# You can change the event name and optional event arguments
8585
snippet $b
8686
$scope.$broadcast '${1:eventName}', ${2:eventArgs}
87-
${3}
87+
${0}
8888
# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function
8989
# You can change the event name and optional event arguments
9090
snippet $e
9191
$scope.$emit '${1:eventName}', ${2:eventArgs}
92-
${3}
92+
${0}
9393
## Directive related snippets
9494
# A compile function
9595
snippet ngdcf
9696
compile = (tElement, tAttrs, transclude) ->
9797
(scope, element, attrs) ->
98-
${1}
98+
${0}
9999
# A linking function in a directive
100100
snippet ngdlf
101101
(scope, element, attrs${1:ctrl}) ->
102-
${2}
102+
${0}
103103
# A directive with a compile function
104104
snippet ngdc
105105
directive '${1:directiveName}', factory = (${2:injectables}) ->
106106
directiveDefinitionObject =
107107
${3:directiveAttrs}
108108
compile: compile = (tElement, tAttrs, transclude) ->
109109
(scope, element, attrs) ->
110+
${0}
110111
directiveDefinitionObject
111112
# A directive with a linking function only
112113
snippet ngdl
113114
.directive('${1:directiveName}', (${2:directiveDeps}) ->
114115
(scope, element, attrs${3:ctrl}) ->
115-
${4}
116-
)
116+
${0}
117+
)

snippets/haml/angular_haml.snippets

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
snippet ngindex
33
%html
44
%head
5-
%script{:src => "https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.2.12}/angular.js"}
5+
%script{:src => "https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.6.3}/angular.js"}
66
%body{"ng-app" => true}
7-
${2}
7+
${0}
88
# Script tag importing base AngularJS file from CDN
99
snippet ngsa
10-
%script{:src => "https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.2.12}/angular.js"}
11-
${2}
10+
%script{:src => "https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.6.3}/angular.js"}
11+
${0}
1212
# A script tag holding Angular's template
1313
snippet ngst
1414
%script{:type => "text/ng-template", :id => "${1:id}"}
15-
${2}
15+
${0}
1616
# A binding in AngularJS
1717
snippet ngb
18-
{{${1:binding}}}${2}
18+
{{${1:binding}}}
1919
# Bind a view to a model
2020
snippet ngm
2121
ng-model="${1:model}"
2222
# Disable a form element
23-
snippet ngd
23+
snippet ngd
2424
ng-disabled="${1:model}"

snippets/html/angular_html.snippets

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
snippet ngindex
33
<html>
44
<head>
5-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.2.12}/angular.js"></script>
5+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.6.3}/angular.js"></script>
66
</head>
77
<body ng-app>
88

9-
${2}
9+
${0}
1010

1111
</body>
1212
</html>
1313
# Script tag importing base AngularJS file from CDN
1414
snippet ngsa
15-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.2.12}/angular.js"></script>
15+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/${1:1.6.3}/angular.js"></script>
1616

17-
${2}
17+
${0}
1818
# A script tag holding Angular's template
1919
snippet ngst
2020
<script type="text/ng-template" id="${1:id}">
21-
${2}
21+
${0}
2222
</script>
2323
# A binding in AngularJS
2424
snippet ngb
25-
{{${1:binding}}}${2}
25+
{{${1:binding}}}
2626
# Bind a view to a model
2727
snippet ngm
2828
ng-model="${1:model}"
2929
# Disable a form element
30-
snippet ngd
30+
snippet ngd
3131
ng-disabled="${1:model}"
3232
# Conditionally render an element
3333
snippet ngi

snippets/javascript/angular_js.snippets

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,44 @@
33
# You can change the controller name and parameters
44
snippet ngc
55
var ${1:controllerName} = function(${2:scope}, ${3:injectables}) {
6-
${4}
6+
${0}
77
};
88
# angular.foreach loop
99
snippet ngfor
1010
angular.forEach(${1:iterateOver}, function(value, key) {
11-
${2}
11+
${0}
1212
});
1313
## Module Based Snippets
1414
# A new angular module without a config function
1515
snippet ngm
1616
angular.module('${1:moduleName}', [${2:moduleDependencies}]);
17-
${3}
17+
${0}
1818
# A new angular module without a config function and a variable assignment
1919
snippet ngma
2020
var ${1:moduleName} = angular.module('$1', [${2:moduleDeps}]);
21-
${3}
21+
${0}
2222
# A new angular module with a config function
2323
snippet ngmc
2424
var ${1:moduleName} = angular.module('$1', [${2:moduleDeps}], function(${3:configDeps}) {
25-
${4}
25+
${0}
2626
});
2727
# A factory in a module
2828
snippet ngmfa
2929
factory('${1:factoryName}', function(${2:dependencies}) {
30-
${3}
30+
${0}
3131
});
3232
# Define an Angular Module Service to be attached to a previously defined module
3333
# You can change the service name and service injectables
3434
snippet ngms
3535
service('${1:serviceName}', function(${2:injectables}) {
36-
${3}
36+
${0}
3737
});
3838
# Define an Angular Module Filter to be attached to a previously defined module
3939
# You can change the filter name
4040
snippet ngmfi
4141
filter('${1:filterName}', function(${2:injectables}) {
4242
return function(input, ${3:args}) {
43-
${4}
43+
${0}
4444
};
4545
});
4646
## Route Based Snippets
@@ -50,7 +50,7 @@ snippet ngrw
5050
templateUrl: '${2:templateUrl}',
5151
controller: '${3:controller}'
5252
});
53-
${4}
53+
${0}
5454
# Defines a when condition of an AngularJS route with the resolve block
5555
snippet ngrwr
5656
$routeProvider.when('${1:url}', {
@@ -60,62 +60,62 @@ snippet ngrwr
6060
${4}
6161
}
6262
});
63-
${5}
63+
${0}
6464
# Defines an otherwise condition of an AngularJS route
6565
snippet ngro
6666
$routeProvider.otherwise({
6767
redirectTo: '${1:url}'
6868
});
69-
${2}
69+
${0}
7070
## Scope Related Snippets
7171
# Define a new $scope'd function (usually inside an AngularJS Controller)
7272
# You can change the function name and arguments
7373
snippet $f
7474
$scope.${1:functionName} = function(${2:args}) {
75-
${3}
75+
${0}
7676
};
7777
# Defines a new $scope'd variable inside an AngularJS controller
7878
snippet $v
7979
$scope.${1:variable} = ${2:value};
80-
${3}
80+
${0}
8181
# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments
8282
snippet $va
8383
$scope.${1:variable} = ${2:variable};
84-
${3}
84+
${0}
8585
# Define a $watch for an expression
8686
# You can change the expression to be watched
8787
snippet $w
8888
$scope.$watch('${1:watchExpr}', function(newValue, oldValue) {
89-
${2}
89+
${0}
9090
});
9191
# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller
9292
# You can change the event name to listen on
9393
snippet $on
9494
$scope.$on('${1:eventName}', function(event, ${2:args}) {
95-
${3}
95+
${0}
9696
});
9797
# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function
9898
# You can change the event name and optional event arguments
9999
snippet $b
100100
$scope.$broadcast('${1:eventName}', ${2:eventArgs});
101-
${3}
101+
${0}
102102
# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function
103103
# You can change the event name and optional event arguments
104104
snippet $e
105105
$scope.$emit('${1:eventName}', ${2:eventArgs});
106-
${3}
106+
${0}
107107
## Directive related snippets
108108
# A compile function
109109
snippet ngdcf
110110
function compile(tElement, tAttrs, transclude) {
111111
return function(scope, element, attrs) {
112-
${1}
112+
${0}
113113
}
114114
}
115115
# A linking function in a directive
116116
snippet ngdlf
117117
function(scope, element, attrs${1:ctrl}) {
118-
${2}
118+
${0}
119119
}
120120
# A directive with a compile function
121121
snippet ngdc
@@ -124,7 +124,7 @@ snippet ngdc
124124
${3:directiveAttrs},
125125
compile: function compile(tElement, tAttrs, transclude) {
126126
return function (scope, element, attrs) {
127-
127+
${0}
128128
}
129129
}
130130
};
@@ -134,6 +134,6 @@ snippet ngdc
134134
snippet ngdl
135135
.directive('${1:directiveName}', function(${2:directiveDeps}) {
136136
return function(scope, element, attrs${3:ctrl}) {
137-
${4}
137+
${0}
138138
}
139-
});
139+
});

0 commit comments

Comments
 (0)