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