Angular Extension Pack for Visual Studio Code
This extension pack packages some of the most popular (and some of my favorite) Angular extensions. If you like it, please leave your Rating & Review
and share with your friends. If you know any extension that is good for Angular development, just let me know by creating an issue.
F12
) and AOT Diagnostic messages.Alt+o
shortcut to switch between Component and the HTML Template.a-class
: [class]
bindinga-style
: [style]
bindinga-ngClass
: ngClass
a-ngStyle
: ngStyle
a-ngSwitch
: ngSwitch
a-select
: <select>
controla-ngFor
: *ngFor
a-ngForAsync
: *ngFor
with asynca-ngFor-trackBy
: *ngFor
with trackBya-ngIf
: *ngIf
a-ngIfElse
: *ngIf
with else
a-ngModel
: ngModel
a-formControlName
: formControlName
a-formGroup
: formGroup
a-formGroupName
: formGroupName
a-routerLink
: routerLink
(include routerLinkActive)a-routerLink-param
: routerLink
with a route parameter (include routerLinkActive)a-prej
: show the JSON form of a modela-preja
: show the JSON form of a model, using asynca-rxjs-import
: import RxJs features (e.g. Observable, of, Subject)a-rxjs-operator
: import RxJs opertors (e.g. map, tap, catchError)a-pipe
: pipea-httpclient-get
: httpClient.get
with Rx Observablea-http-interceptor
: Empty Angular HttpInterceptor
for HttpClient
a-http-interceptor-headers
: Angular HttpInterceptor
that sets headers for HttpClient
a-http-interceptor-logging
: Angular HttpInterceptor
that logs traffic for HttpClient
a-service-httpclient
: service with HttpClient
a-route-path-404
: 404 route patha-route-path-lazy
: lazy route patha-route-path-default
: default route patha-route-path-with-children
: route path with childrena-route-path-eager
: eager route patha-route-path-lazy
: lazy route patha-router-events
: listen to one or more router eventsa-route-params-subscribe
: subscribe to route parametersa-guard-can-load
: CanLoad
guarda-guard-can-activate
: CanActivate
guarda-guard-can-activate-child
: CanActivateChild
guarda-guard-can-deactivate
: CanDeactivate
guarda-preload-strategy
: implements PreloadingStrategy classa-output-event
: @Output
event and emitterex-simple-server
: Node.js Express Serverdocker-angular-node-multi-stage
: Multi-stage Dockerfile for Node with AngularAngular 10 Snippets - TypeScript, Html, Angular Material, ngRx, RxJS & Flex Layout
"editor.snippetSuggestions": "top"
t-
(Test Snippets)e-
(Test Expect Snippets)ng-
(Angular Snippets)fx-
(Angular Flex Layout Snippets)m-
(Angular Material Design Snippets)rx-
(RxJS Snippets for both TypeScript and JavaScript)sw-
(Service Workers Snippets)pwa-
(Progressive Web Applications Snippets)ngrx-
(Angular NgRx Snippets)ngxs-
(Angular NGXS Snippets)Some notes about importing RxJS stuff
import { Observable } from 'rxjs';
rxjs
!import { map } from 'rxjs/operators';
rxjs/operators
!imp→
imports entire module import fs from 'fs';
imn→
imports entire module without module name import 'animate.css'
ime→
imports everything as alias from the module import * as localAlias from 'fs';
imd→
imports only a portion of the module using destructing import { rename } from 'fs';
ima→
imports only a portion of the module as alias import { rename as localRename } from 'fs';
enf→
exports name function export const log = (parameter) => { console.log(parameter);};
edf→
exports default function export default (parameter) => { console.log(parameter);};
ecl→
exports default class export default class Calculator { };
ece→
exports default class by extending a base one export default class Calculator extends BaseClass { };
con→
adds default constructor in the class constructor() {}
met→
creates a method inside a class add() {}
pge→
creates a getter property get propertyName() {return value;}
pse→
creates a setter property set propertyName(value) {}
fre→
forEach loop in ES6 syntax array.forEach(currentItem => {})
fof→
for ... of loop for(let item of object) {}
fin→
for ... in loop for(let item in object) {}
anfn→
creates an anonymous function (params) => {}
nfn→
creates a named function const add = (params) => {}
sti→
set interval helper method setInterval(() => {});
sto→
set timeout helper method setTimeout(() => {});
prom→
creates a new Promise return new Promise((resolve, reject) => {});
thenCatch→
adds then and catch declaration to a promise .then((res) => {).catch((err) => {});
clg→
console log console.log(object)
cdi→
console dir console.dir
clt→
console table console.table
x: Add semicolons
( There is so convenient shortcut: Ctrl+;
)x: Remove semicolons
( There is so convenient shortcut: Ctrl+Shift+;
)x: Property to getter/setter
x: Arrow function all single statement blocks to expression
quicktype
infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. For more explanation, read A first look at quicktype.C#
, Go
, C++
, Java
, TypeScript
, Swift
, Elm
, and JSON Schema
. I have to say THIS IS AWESOME! Just try it.Ctrl+Alt+D
and again Ctrl+Alt+D
(hit twice) to generates documentation.Enable VSCode built-in Linked Editing (Auto update tags) feature.
"editor.linkedEditing": true
F12
on the CSS class in HTML that will trigger Go To Definition command and preview CSS content.You need to install the following extensions manually.
"prettier.singleQuote": true
"editor.formatOnSave": false
editor.formatOnSave
setting.*.log
files."gitlens.currentLine.enabled": false
ng-nginx
snippet, you might want to install this extension for authoring nginx.conf
file."editor.fontFamily": "Fira Code, Consolas, 'Courier New', monospace"
"editor.fontLigatures": true
to enabled it."editor.fontLigatures": true
"editor.fontFamily": "Fira Code, 'Noto Sans CJK TC Medium', Consolas, 'Courier New', monospace"
"editor.fontLigatures": true
"editor.fontFamily": "Fira Code, 'Noto Sans CJK SC Medium', Consolas, 'Courier New', monospace"
"editor.minimap.renderCharacters": false
"emmet.showSuggestionsAsSnippets": true
This extension contains supplementary code snippets to Angular Snippets (Version 12) & Angular 10 Snippets - TypeScript, Html, Angular Material, ngRx, RxJS & Flex Layout.
ng-import-FormsModule
: imports FormsModule
from @angular/forms
ng-import-ReactiveFormsModule
: imports ReactiveFormsModule
from @angular/forms
ng-import-HttpClientModule
: imports HttpClientModule
from @angular/common/http
ngDoBootstrap
: generates ngDoBootstrap()
method for AppModule
ng-import-element
: imports createCustomElement
and Injector
for Angular Elementsng-elements
: create required Angular Elements boilerplate on AppModuleng-import-LazyElementsModule
: imports LazyElementsModule
from @angular-extensions/elements
ng-bootstrapModule-NoopZone
: Setting up NoopZone in main.ts
ng-polyfills-zonejs-flags
: Setting up Zone.js flagsa-ngSubmit
: Angular Forms's ngSubmit
eventa-formArrayName
: Angular formArrayName
a-formGroupName
: Angular formGroupName
a-routerLinkActive
: Angular routerLinkActive="active"
a-routerLinkActiveOptions
: Angular [routerLinkActiveOptions]="{exact: true}"
a-axLazyElement
: Lazy load Angular Elements or any other web components / custom elements
ng-nginx
: NGINX configuration for Angular (nginx.conf
)ng-dockerfile
: Multi-stage build for Angular and Nginx Dockerfile
ng build
or npm run build --
command.Enjoy!