UNPKG

1.37 kBMarkdownView Raw
1# Angular 2 TypeScript Snippets for VS Code
2
3**Now Updated for Angular 2.0.0 release**
4
5This extension for Visual Studio Code adds snippets for Angular 2 for TypeScript and HTML.
6
7![Use Extension](images/use-extension.gif)
8
9## Usage
10Type part of a snippet, press `enter`, and the snippet unfolds.
11
12### TypeScript Snippets
13```typescript
14ng2-bootstrap // Angular 2 bootstrapping, for main.ts
15ng2-component // Angular 2 component
16ng2-component-root // Angular 2 root app component
17ng2-http-get // Angular 2 http.get with Rx Observable
18ng2-module // Angular 2 module
19ng2-module-root // Angular 2 root app module
20ng2-pipe // Angular 2 pipe
21ng2-routing // Angular 2 routing
22ng2-service // Angular 2 service
23ng2-subscribe // Angular 2 Rx Observable subscription
24```
25
26###HTML Snippets
27```html
28ng2-ngClass
29ng2-ngFor
30ng2-ngIf
31ng2-ngModel
32ng2-routerLink
33ng2-ngStyle
34ng2-ngSwitch
35```
36
37Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (OSX) to activate snippets from within the editor.
38
39## Installation
40
411. Install Visual Studio Code 0.10.1 or higher
422. Launch Code
433. From the command palette `Ctrl`-`Shift`-`P` (Windows, Linux) or `Cmd`-`Shift`-`P` (OSX)
444. Select `Install Extension`
455. Choose the extension
466. Reload Visual Studio Code
47
48![Install Extension](images/install-extension.gif)