Skip to content

Commit

Permalink
added http-get, pipe, route-definition, routes, and subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
pjlamb12 committed May 5, 2016
1 parent cdc487d commit 0153998
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion snippets/ng2-component.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export class ${3:ComponentName}Component implements OnInit {
]]></content>
<tabTrigger>ng2-component</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description></description>
<description>Angular 2 Component Snippet</description>
</snippet>
9 changes: 9 additions & 0 deletions snippets/ng2-http-get.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
return this.${1:http}.get('${2:url}')
.map((res: Response) => res.json());$0
]]></content>
<tabTrigger>ng2-http-get</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description>Angular 2 HTTP Get Snippet</description>
</snippet>
21 changes: 21 additions & 0 deletions snippets/ng2-pipe.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<snippet>
<content><![CDATA[
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: '${1:pipeName}'
})
export class ${2:PipeName}Pipe implements PipeTransform {
transform(value: any, args: any[]): any {
if(value) {
$0
} else {
return '';
}
}
}
]]></content>
<tabTrigger>ng2-pipe</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description>Angular 2 Pipe Snippet</description>
</snippet>
8 changes: 8 additions & 0 deletions snippets/ng2-route-definition.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<snippet>
<content><![CDATA[
{ path: '/${1:path}', component: ${2:Component}, name: '${2:Component}' }
]]></content>
<tabTrigger>ng2-route-definition</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description>Angular 2 Route Definition Snippet</description>
</snippet>
10 changes: 10 additions & 0 deletions snippets/ng2-routes.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
@Routes([
{ path: '/${1:path}', component: ${2:Component}, name: '${2:Component}' }
])
]]></content>
<tabTrigger>ng2-routes</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description>Angular 2 Routes Snippet</description>
</snippet>
4 changes: 2 additions & 2 deletions snippets/ng2-service.sublime-snippet
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class ${1:ServiceName}Service {
constructor() {}
}
]]></content>
<tabTrigger>ng2-component</tabTrigger>
<tabTrigger>ng2-service</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description></description>
<description>Angular 2 Service Snippet</description>
</snippet>
9 changes: 9 additions & 0 deletions snippets/ng2-subscribe.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
this.${1:service}.${2:function}()
.subscribe(${3:arg} => this.${4:property} = ${3:arg});$0
]]></content>
<tabTrigger>ng2-subscribe</tabTrigger>
<scope>source.ts,source.tsx</scope>
<description>Angular 2 Subscribe Snippet</description>
</snippet>

0 comments on commit 0153998

Please sign in to comment.