Skip to content

Commit 4b61478

Browse files
henriquecustodiajohnpapa
authored andcommitted
Adding ng-container, ng-template and ng-content snippets
1 parent b98fac0 commit 4b61478

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
- Added `a-form` to create a form tag with ngSubmit and form attributes
88
- Added `a-form-submit` to create a submit button for a form
99
- Fixed `a-service` to create a service with injectable provided in root
10+
- Added `a-ng-container` to create `<ng-container>` element
11+
- Added `a-ng-template` to create `<ng-template>` element
12+
- Added `a-ng-content` to create `<ng-content>` element
1013

1114
<a name="8.2.0"></a>
1215

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check out the [Angular Essentials extension](https://marketplace.visualstudio.co
1616

1717
Type part of a snippet, press `enter`, and the snippet unfolds.
1818

19-
Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (OSX) to activate snippets from within the editor.
19+
Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (macOS) to activate snippets from within the editor.
2020

2121
### Command Palette Commands
2222

@@ -114,6 +114,9 @@ Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (OSX) to a
114114
| `a-ngSwitch` | `ngSwitch` |
115115
| `a-prej` | show the JSON form of a model |
116116
| `a-preja` | show the JSON form of a model, using async |
117+
| `a-ng-container` | `<ng-container>` element |
118+
| `a-ng-template` | `<ng-template>` element |
119+
| `a-ng-content` | `<ng-content>` element |
117120

118121
### VS Code Snippets
119122

snippets/html.json

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,32 @@
3131
},
3232
"ngForm": {
3333
"prefix": "a-form",
34-
"body": [
35-
"<form (ngSubmit)=\"onSubmit()\" #${1:form}=\"ngForm\">",
36-
"</form>"
37-
],
34+
"body": ["<form (ngSubmit)=\"onSubmit()\" #${1:form}=\"ngForm\">", "</form>"],
3835
"description": "Form with ngSubmit and form attributes"
3936
},
4037
"ngFormArrayName": {
4138
"prefix": "a-formArrayName",
42-
"body": [
43-
"formArrayName=\"${1:control}\""
44-
],
39+
"body": ["formArrayName=\"${1:control}\""],
4540
"description": "Angular formArrayName"
4641
},
4742
"ngFormControlName": {
4843
"prefix": "a-formControlName",
49-
"body": [
50-
"formControlName=\"${1:control}\""
51-
],
44+
"body": ["formControlName=\"${1:control}\""],
5245
"description": "Angular formControlName"
5346
},
5447
"ngFormGroup": {
5548
"prefix": "a-formGroup",
56-
"body": [
57-
"[formGroup]=\"${1:form}\""
58-
],
49+
"body": ["[formGroup]=\"${1:form}\""],
5950
"description": "Angular formGroup"
6051
},
6152
"ngFormGroupName": {
6253
"prefix": "a-formGroupName",
63-
"body": [
64-
"[formGroupName]=\"${1:name}\""
65-
],
54+
"body": ["[formGroupName]=\"${1:name}\""],
6655
"description": "Angular formGroupName"
6756
},
6857
"ngFormSubmit": {
6958
"prefix": "a-form-submit",
70-
"body": [
71-
"<button type=\"submit\" [disabled]=\"!${1:form}.form.valid\">",
72-
"\tSave",
73-
"</button>"
74-
],
59+
"body": ["<button type=\"submit\" [disabled]=\"!${1:form}.form.valid\">", "\tSave", "</button>"],
7560
"description": "Angular form submit"
7661
},
7762
"ngIf": {
@@ -91,9 +76,7 @@
9176
},
9277
"ngRouterLink": {
9378
"prefix": "a-routerLink",
94-
"body": [
95-
"[routerLink]=\"['/${1:routePath}']\" routerLinkActive=\"${2:router-link-active}\" $0"
96-
],
79+
"body": ["[routerLink]=\"['/${1:routePath}']\" routerLinkActive=\"${2:router-link-active}\" $0"],
9780
"description": "Angular routerLink"
9881
},
9982
"ngRouterLinkWithParameter": {
@@ -137,5 +120,20 @@
137120
"prefix": "a-preja",
138121
"body": ["<pre>{{${1:model} | async | json}}</pre>$0"],
139122
"description": "Angular pre debug | async | json"
123+
},
124+
"ng-container": {
125+
"prefix": "a-ng-container",
126+
"body": ["<ng-container $0></ng-container>"],
127+
"description": "Angular ng-container"
128+
},
129+
"ng-template": {
130+
"prefix": "a-ng-template",
131+
"body": ["<ng-template [ngTemplateOutlet]=\"${1:outlet}\" [ngOutletContext]=\"${2:context}\"></ng-template>"],
132+
"description": "Angular ng-template"
133+
},
134+
"ng-content": {
135+
"prefix": "a-ng-content",
136+
"body": ["<ng-content select=\"${0:selector}\"></ng-content>"],
137+
"description": "Angular ng-content"
140138
}
141-
}
139+
}

0 commit comments

Comments
 (0)