Repository navigation
Expand file tree
/
Copy pathAngular2-Snippets.xml
More file actions
139 lines (139 loc) · 10.2 KB
/
Copy pathAngular2-Snippets.xml
File metadata and controls
139 lines (139 loc) · 10.2 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<templateSet group="Angular2 Snippets">
<template name="ng2-bootstrap" value="import { enableProdMode } from '@angular/core'; import { bootstrap } from '@angular/platform-browser-dynamic'; import { $COMPONENT_NAME$ } from './$NAME$.component'; // enableProdMode(); bootstrap($COMPONENT_NAME$) .then(success => console.log(`Bootstrap success`)) .catch(error => console.log(error)); $END$" description="Angular2 bootstrap snippet" toReformat="false" toShortenFQNames="true">
<variable name="COMPONENT_NAME" expression="" defaultValue=""AppComponent"" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-component" value="import { Component, OnInit } from '@angular/core'; @Component({ moduleId: module.id, selector: '$SELECTOR$', templateUrl: '$NAME$.component.html' }) export class $COMPONENT_NAME$Component implements OnInit { constructor() { } ngOnInit() { } $END$ }" description="Angular2 component snippet" toReformat="false" toShortenFQNames="true">
<variable name="SELECTOR" expression="" defaultValue=""selector"" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="COMPONENT_NAME" expression="capitalize(String)" defaultValue=""ComponentName"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
<option name="CoffeeScript" value="false" />
</context>
</template>
<template name="ng2-component-root" value="import { Component } from '@angular/core'; import { HTTP_PROVIDERS } from '@angular/http'; import { Routes, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router'; import 'rxjs/Rx'; // load the full rxjs @Component({ moduleId: module.id, selector: '$SELECTOR$', templateUrl: '$NAME$.component.html', directives: [ROUTER_DIRECTIVES], providers: [ HTTP_PROVIDERS, ROUTER_PROVIDERS ] }) @Routes([ $END$ ]) export class AppComponent {}" description="Angular2 root component snippet" toReformat="false" toShortenFQNames="true">
<variable name="SELECTOR" expression="" defaultValue=""selector"" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-http-get" value="return this.http.get('$URL$') .map((res: Response) => res.json()$END$);" description="Angular2 http get snippet" toReformat="false" toShortenFQNames="true">
<variable name="URL" expression="" defaultValue=""url"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-pipe" value="import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: '$NAME$' }) export class $PIPE_NAME$Pipe implements PipeTransform { transform(value: any, args: any[]): any { $END$ } }" description="Angular2 pipe snippet" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="PIPE_NAME" expression="" defaultValue=""PipeName"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-route-path" value="{ path: '/$PATH$', component: $COMPONENT$ $END$}" description="Angular2 route path snippet" toReformat="false" toShortenFQNames="true">
<variable name="PATH" expression="" defaultValue=""path"" alwaysStopAt="true" />
<variable name="COMPONENT" expression="" defaultValue=""Component"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-routes" value="@Routes([ { path: '/$PATH$', component: $COMPONENT$ }$END$ ])" description="Angular2 routes snippet" toReformat="false" toShortenFQNames="true">
<variable name="PATH" expression="" defaultValue=""path"" alwaysStopAt="true" />
<variable name="COMPONENT" expression="" defaultValue=""Component"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-service" value="import { Injectable } from '@angular/core'; @Injectable() export class $TEST$$SERVICE_NAME$Service { constructor($END$) { } }" description="Angular2 service snippet" toReformat="false" toShortenFQNames="true">
<variable name="TEST" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="SERVICE_NAME" expression="capitalize(SERVICE_NAME)" defaultValue="" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-subscribe" value="this.$SERVICE$.$FUNCTION$() .subscribe($ARG$ => this.$PROPERTY$ = $ARG$); $END$ " description="Angular2 subscribe snippet" toReformat="false" toShortenFQNames="true">
<variable name="SERVICE" expression="" defaultValue=""service"" alwaysStopAt="true" />
<variable name="FUNCTION" expression="" defaultValue=""function"" alwaysStopAt="true" />
<variable name="ARG" expression="" defaultValue=""arg"" alwaysStopAt="true" />
<variable name="PROPERTY" expression="" defaultValue=""property"" alwaysStopAt="true" />
<context>
<option name="TypeScript" value="true" />
</context>
</template>
<template name="ng2-ngClass" value="[ngClass]="{$CSS_CLASS$: $EXPRESSION$}"" description="Angular2 ngClass snippet" toReformat="false" toShortenFQNames="true">
<variable name="CSS_CLASS" expression="" defaultValue=""cssClass"" alwaysStopAt="true" />
<variable name="EXPRESSION" expression="" defaultValue=""expression"" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
<option name="RHTML" value="false" />
</context>
</template>
<template name="ng2-ngFor" value="*ngFor="let $ITEM$ of $LIST$"" description="Angular2 ngFor snippet" toReformat="false" toShortenFQNames="true">
<variable name="ITEM" expression="" defaultValue=""item"" alwaysStopAt="true" />
<variable name="LIST" expression="" defaultValue=""list"" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="ng2-ngIf" value="*ngIf="$EXPRESSION$"" description="Angular2 ngIf snippet" toReformat="false" toShortenFQNames="true">
<variable name="EXPRESSION" expression="" defaultValue=""expression"" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="ng2-ngModel" value="[(ngModel)]="$BINDING$"" description="Angular2 ngModel snippet" toReformat="false" toShortenFQNames="true">
<variable name="BINDING" expression="" defaultValue=""binding"" alwaysStopAt="true" />
<context />
</template>
<template name="ng2-ngStyle" value="[ngStyle]="{$STYLE$: $EXPRESSION$}"" description="Angular2 ngStyle snippet" toReformat="false" toShortenFQNames="true">
<variable name="STYLE" expression="" defaultValue=""style"" alwaysStopAt="true" />
<variable name="EXPRESSION" expression="" defaultValue=""expression"" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
</context>
</template>
<template name="ng2-ngSwitch" value="<div [ngSwitch]="$CONDITION_EXPRESSION$"> <div *ngSwitchWhen="$EXPRESSION$">$OUTPUT$</div> <div *ngSwitchDefault>$DEFAULT_OUTPUT$</div> </div>" description="Angular2 ngSwitch snippet" toReformat="false" toShortenFQNames="true">
<variable name="CONDITION_EXPRESSION" expression="" defaultValue=""conditionExpression"" alwaysStopAt="true" />
<variable name="EXPRESSION" expression="" defaultValue=""expression"" alwaysStopAt="true" />
<variable name="OUTPUT" expression="" defaultValue=""output"" alwaysStopAt="true" />
<variable name="DEFAULT_OUTPUT" expression="" defaultValue=""default output"" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
<option name="XML_TEXT" value="false" />
<option name="JSON" value="false" />
<option name="RUBY" value="false" />
<option name="RHTML" value="false" />
<option name="CSS_PROPERTY_VALUE" value="false" />
<option name="CSS_DECLARATION_BLOCK" value="false" />
<option name="CSS_RULESET_LIST" value="false" />
<option name="CSS" value="false" />
<option name="SQL" value="false" />
<option name="CUCUMBER_FEATURE_FILE" value="false" />
<option name="JAVA_SCRIPT" value="false" />
<option name="JS_EXPRESSION" value="false" />
<option name="JSX_HTML" value="false" />
<option name="JS_STATEMENT" value="false" />
<option name="TypeScript" value="false" />
<option name="CoffeeScript" value="false" />
<option name="HAML" value="false" />
<option name="Slim" value="false" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="ng2-routerLink" value="[routerLink]="['$ROUTE_NAME$']"" description="Angular2 routerLink snippet" toReformat="false" toShortenFQNames="true">
<variable name="ROUTE_NAME" expression="" defaultValue=""routeName"" alwaysStopAt="true" />
<context />
</template>
</templateSet>