Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit d479f58

Browse files
committed
Merge pull request #8 from btesser/master
feat: Ctrl with $inject/Ctrl Proto Methods/Ngdocs
2 parents eb99724 + 9b04f8c commit d479f58

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

‎README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,13 @@ $scope.$1 = function($2) {
384384
};
385385
```
386386

387+
##### ngcp
388+
```
389+
$1Ctrl.prototype.$2 = function $2($3) {
390+
$4
391+
};
392+
```
393+
387394
##### ngon
388395
```
389396
$scope.$on('$1', function(event, $2) {
@@ -410,6 +417,26 @@ var $1 = function($scope, $2) {
410417
}
411418
```
412419

420+
##### ngc$
421+
```
422+
$1Ctrl.$inject = [$scope, '$2'];
423+
function $1Ctrl($scope, $2) {
424+
$4
425+
}
426+
angular.module($3).controller('$1Ctrl', $1Ctrl);
427+
```
428+
429+
##### ngdoc
430+
```
431+
/**
432+
* @ngdoc ${1:function}
433+
* @name $2
434+
* @description
435+
* $3
436+
*
437+
*/
438+
```
439+
413440
##### nghttp
414441
```
415442
$http({method: '${1:GET}', url: '$2'})

‎snippets/js-templates.cson

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@
123123
$3
124124
};
125125
"""
126+
"controller prototype method":
127+
"prefix": "ngcp"
128+
"body": """
129+
$1Ctrl.prototype.$2 = function $2($3) {
130+
$4
131+
};
132+
"""
126133
"$scope.$on":
127134
"prefix": "ngon"
128135
"body": """
@@ -147,7 +154,27 @@
147154
"body": """
148155
var $1 = function($scope, $2) {
149156
$3
157+
};
158+
"""
159+
"controller $inject Syntax":
160+
"prefix": "ngc$"
161+
"body": """
162+
$1Ctrl.$inject = [$scope, '$2'];
163+
function $1Ctrl($scope, $2) {
164+
$4
150165
}
166+
angular.module($3).controller('$1Ctrl', $1Ctrl);
167+
"""
168+
"ngdocs comment":
169+
"prefix": "ngdoc"
170+
"body": """
171+
/**
172+
* @ngdoc ${1:function}
173+
* @name $2
174+
* @description
175+
* $3
176+
*
177+
*/
151178
"""
152179
"$http":
153180
"prefix": "nghttp"

0 commit comments

Comments
 (0)
X