Skip to content

Commit 7a8b23d

Browse files
authored
feat: add snippet for standalone component (#139)
Co-authored-by: George Knap <[email protected]>
1 parent 6d8fe9a commit 7a8b23d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Alternatively, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (macOS) to
2929
| Snippet | Purpose |
3030
| ---------------------------- | -------------------------------------------------------------------- |
3131
| `a-component` | component |
32+
| `a-component-standalone` | standalone component |
3233
| `a-component-inline` | component with inline template |
3334
| `a-component-root` | root app component |
3435
| `a-ctor-skip-self` | angular `NgModule`'s `skipself` constructor |

snippets/typescript.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,26 @@
1717
"}"
1818
]
1919
},
20+
"Angular Standalone Component": {
21+
"prefix": "a-component-standalone",
22+
"description": "Angular standalone component",
23+
"body": [
24+
"import { Component, OnInit } from '@angular/core';",
25+
"",
26+
"@Component({",
27+
"\tstandalone: true,",
28+
"\timports: [],",
29+
"\tselector: '${1:selector-name}',",
30+
"\ttemplateUrl: '${2:name}.component.html'",
31+
"})",
32+
"",
33+
"export class ${3:Name}Component implements OnInit {",
34+
"\tconstructor() { }",
35+
"",
36+
"\tngOnInit() { }$0",
37+
"}"
38+
]
39+
},
2040
"Angular Component with Inline Template": {
2141
"prefix": "a-component-inline",
2242
"description": "Angular component with an inline template",

0 commit comments

Comments
 (0)