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.
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": " " } ]
Snippet Categories:
Completion Categories:
Trigger: component
description | completion |
---|---|
@Component |
|
@Component (Basic) |
|
@Component (External) |
|
@Component (Complex) |
|
Trigger: directive
description | completion |
---|---|
@Directive |
|
@Directive (Basic) |
|
@Directive (Complex) |
|
Trigger: service
description | completion |
---|---|
Service |
|
Trigger: pipe
description | completion |
---|---|
Pipe |
|
Pipe (ES6) |
|
Trigger: routeconfig
description | completion |
---|---|
@RouteConfig |
|
@RouteConfig (Basic) |
|
Trigger: route
description | completion |
---|---|
Route |
|
Route (Default) |
|
Route (Redirect) |
|
Route (Param) |
|
Route (Wildcard) |
|
Route (Data) |
|
Route (Parent) |
|
description | completion |
---|
trigger | completion |
---|---|
selector |
|
inputs |
|
outputs |
|
providers |
|
viewProviders |
|
template |
|
templateUrl |
|
styles |
|
styleUrls |
|
directives |
|
pipes |
|
properties |
|
host |
|
trigger | completion |
---|---|
@Inject |
|
@Input |
|
@Output |
|
@HostBinding |
|
@HostListener |
|
@ContentChild |
|
@ContentChildren |
|
@ViewChild |
|
@ViewChildren |
|
trigger | completion |
---|---|
constructor |
|
ngOnChanges |
|
ngOnInit |
|
ngDoCheck |
|
ngAfterContentInit |
|
ngAfterContentChecked |
|
ngAfterViewInit |
|
ngAfterViewChecked |
|
ngOnDestroy |
|
trigger | completion |
---|---|
@CanActivate |
|
routerOnActivate |
|
routerCanReuse |
|
routerOnReuse |
|
routerCanDeactivate |
|
routerOnDeactivate |
|
trigger | completion |
---|---|
ngClass |
|
ngIf |
|
ngIf |
|
ngFor |
|
ngForOf |
|
ngStyle |
|
ngSwitch |
|
ngSwitchDefault |
|
ngSwitchWhen |
|
ngModel |
|
ngModel |
|
ngModelChange |
|
trigger | completion |
---|