Skip to content

Commit 0ec87f5

Browse files
committed
added ngroute and ngwhen
1 parent f430bdb commit 0ec87f5

2 files changed

Lines changed: 69 additions & 35 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,12 +2860,14 @@ Use file templates or snippets to help follow consistent styles and patterns. He
28602860
ngapp // creates an Angular module setter
28612861
ngservice // creates an Angular service
28622862
ngfilter // creates an Angular filter
2863+
ngroute // creates an Angular routeProvider
28632864

28642865
// These are partial snippets intended to chained
28652866
ngmodule // creates an Angular module getter
28662867
ngstate // creates an Angular UI Router state defintion
28672868
ngconfig // defines a configuration phase function
28682869
ngrun // defines a run phase function
2870+
ngwhen // defines a route for the routeProvider
28692871
```
28702872
28712873
**[Back to top](#table-of-contents)**

assets/brackets-angular-snippets.yaml

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- trigger: ngfilter
2-
description: Angular filter using John Papa's Angular style guide
2+
description: "Angular filter using John Papa's Angular style guide"
33
scope: javascript
44
text: |
55
(function () {
@@ -20,7 +20,7 @@
2020
})();
2121
2222
- trigger: ngservice
23-
description: Angular service using John Papa's Angular style guide
23+
description: "Angular service using John Papa's Angular style guide"
2424
scope: javascript
2525
text: |
2626
(function () {
@@ -34,17 +34,17 @@
3434
/* @ngInject */
3535
function ${2:Service}(${3:dependencies}) {
3636
this.${4:func} = ${4:func};
37-
37+
3838
////////////////
39-
39+
4040
function ${4:func}() {
41-
41+
4242
}
4343
}
4444
})();
4545
4646
- trigger: ngapp
47-
description: Angular module app definition using John Papa's Angular style guide
47+
description: "Angular module app definition using John Papa's Angular style guide"
4848
scope: javascript
4949
text: |
5050
(function () {
@@ -58,7 +58,7 @@
5858
})();
5959
6060
- trigger: ngfactory
61-
description: Angular factory using John Papa's Angular style guide
61+
description: "Angular factory using John Papa's Angular style guide"
6262
scope: javascript
6363
text: |
6464
(function () {
@@ -85,7 +85,7 @@
8585
})();
8686
8787
- trigger: ngdirective
88-
description: Angular directive using John Papa's Angular style guide
88+
description: "Angular directive using John Papa's Angular style guide"
8989
scope: javascript
9090
text: |
9191
(function () {
@@ -127,7 +127,7 @@
127127
})();
128128
129129
- trigger: ngcontroller
130-
description: Angular controller using John Papa's Angular style guide
130+
description: "Angular controller using John Papa's Angular style guide"
131131
scope: javascript
132132
text: |
133133
(function() {
@@ -154,46 +154,78 @@
154154
})();
155155
156156
- trigger: ngstate
157-
description: Angular UI-Router state using John Papa's Angular style guide
157+
description: "Angular UI-Router state using John Papa's Angular style guide"
158158
scope: javascript
159159
text: |
160-
state('${1:state}', {
161-
url: '${2:/url}'
162-
templateUrl: '${3:template}.html',
163-
controller: '${4:Controller}'
164-
controllerAs: '${5:vm}'
165-
})
166-
160+
state('${1:state}', {
161+
url: '${2:/url}'
162+
templateUrl: '${3:template}.html',
163+
controller: '${4:Controller}'
164+
controllerAs: '${5:vm}'
165+
})
167166
168167
- trigger: ngmodule
169-
description: Angular module getter using John Papa's Angular style guide
168+
description: "Angular module getter using John Papa's Angular style guide"
170169
scope: javascript
171170
text: |
172-
angular
173-
.module('${1:module}')
171+
angular
172+
.module('${1:module}')
174173
175174
- trigger: ngconfig
176-
description: Angular config phase function using John Papa's Angular style guide
175+
description: "Angular config phase function using John Papa's Angular style guide"
177176
scope: javascript
178177
text: |
179-
.config(${1:configuration})
180-
181-
${1:configuration}.$inject = ['${2:dependencies}'];
182-
183-
/* @ngInject */
184-
function ${1:configuration} (${2:dependencies}) {
185-
186-
}
178+
.config(${1:configuration})
179+
180+
${1:configuration}.$inject = ['${2:dependencies}'];
181+
182+
/* @ngInject */
183+
function ${1:configuration} (${2:dependencies}) {
184+
185+
}
187186
188187
- trigger: ngrun
189-
description: Angular run phase function using John Papa's Angular style guide
188+
description: "Angular run phase function using John Papa's Angular style guide"
190189
scope: javascript
191190
text: |
192-
.run(${1:runFn})
191+
.run(${1:runFn})
192+
193+
${1:runFn}.$inject = ['${2:dependencies}'];
194+
195+
/* @ngInject */
196+
function ${1:runFn} (${2:dependencies}) {
197+
198+
}
193199
194-
${1:runFn}.$inject = ['${2:dependencies}'];
200+
- trigger: ngroute
201+
description: "Angular routeProvider using John Papa's Angular style guide"
202+
scope: javascript
203+
mTime: 1426416190583
204+
text: |
205+
(function() {
206+
'use strict';
207+
208+
angular
209+
.module( '${1:app}' )
210+
.config( function( $routeProvider ) {
211+
$routeProvider
212+
.when( '/', {
213+
templateUrl: '${2:home}.html',
214+
controller: '${3:Home}',
215+
controllerAs: 'vm'
216+
})
217+
218+
});
219+
})();
195220
196-
/* @ngInject */
197-
function ${1:runFn} (${2:dependencies}) {
221+
- trigger: ngwhen
222+
description: "Defines a route for routeProvider using John Papa's style guide"
223+
scope: javascript
224+
mTime: 1426416499728
225+
text: |
226+
.when( '/${1:home}', {
227+
templateUrl: '${1:home}.html',
228+
controller: '${2:Home}',
229+
controllerAs: '${3:vm}'
230+
})
198231
199-
}

0 commit comments

Comments
 (0)