angular2-snippets
angular2-snippets copied to clipboard
Sublime Text Snippets and Completions for
Angular2 Snippets for Sublime Text
This package provides snippets and completions for Angular2. Sublime Text uses fuzzy searching for snippets/completions, therefore you can trigger either without having to write out the whole trigger.
Installation
Package Control
Notice: submission to package control is still pending so 'Manual' install is the only option at this time.
- open the
Command Palette(⌘ + ⇧ + p | SUPER + SHIFT + p) - select
Package Control: Install Package(p + i) - select
Angular2 Snippets
Manual
- copy/clone the files into your Sublime Text User Preferences folder
Config
-
to enable auto-completion add the following to
User.sublime-preferences"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"}, {"selector": "text.html meta.tag", "characters": " " } ]
Directory
Snippet Categories:
- Component
- Directive
- Service
- Pipe
- RouteConfig
- Route
- Test
Completion Categories:
- Annotations
- Decorators
- Lifecycle
- Routing
- Directives
- Attributes
- Pipes
Snippets
Component
Trigger: component
| description | completion |
|---|---|
| @Component | |
| @Component (Basic) | |
| @Component (External) | |
| @Component (Complex) | |
Directive
Trigger: directive
| description | completion |
|---|---|
| @Directive | |
| @Directive (Basic) | |
| @Directive (Complex) | |
Service
Trigger: service
| description | completion |
|---|---|
| Service | |
Pipe
Trigger: pipe
| description | completion |
|---|---|
| Pipe | |
| Pipe (ES6) | |
RouteConfig
Trigger: routeconfig
| description | completion |
|---|---|
| @RouteConfig | |
| @RouteConfig (Basic) | |
Route
Trigger: route
| description | completion |
|---|---|
| Route | |
| Route (Default) | |
| Route (Redirect) | |
| Route (Param) | |
| Route (Wildcard) | |
| Route (Data) | |
| Route (Parent) | |
Test
| description | completion |
|---|
Completions
Annotations
| trigger | completion |
|---|---|
| selector | |
| inputs | |
| outputs | |
| providers | |
| viewProviders | |
| template | |
| templateUrl | |
| styles | |
| styleUrls | |
| directives | |
| pipes | |
| properties | |
| host | |
Decorators
| trigger | completion |
|---|---|
| @Inject | |
| @Input | |
| @Output | |
| @HostBinding | |
| @HostListener | |
| @ContentChild | |
| @ContentChildren | |
| @ViewChild | |
| @ViewChildren | |
Lifecycle
| trigger | completion |
|---|---|
| constructor | |
| ngOnChanges | |
| ngOnInit | |
| ngDoCheck | |
| ngAfterContentInit | |
| ngAfterContentChecked | |
| ngAfterViewInit | |
| ngAfterViewChecked | |
| ngOnDestroy | |
Routing
| trigger | completion |
|---|---|
| @CanActivate | |
| routerOnActivate | |
| routerCanReuse | |
| routerOnReuse | |
| routerCanDeactivate | |
| routerOnDeactivate | |
Directives
| trigger | completion |
|---|---|
| ngClass | |
| ngIf | |
| ngIf | |
| ngFor | |
| ngForOf | |
| ngStyle | |
| ngSwitch | |
| ngSwitchDefault | |
| ngSwitchWhen | |
| ngModel | |
| ngModel | |
| ngModelChange | |
Pipes
| trigger | completion |
|---|