-
extensions.json
- has additional extensions I recommend for doing Angular development.- Angular Language Service (
angular.ng-template
). Required - Prettier - (
esbenp.prettier-vscode
) - code formatting. - ESLint - (
dbaeumer.vscode-eslint
) - Linting for JS/TS - Tailwind (
bradlc.vscode-tailwindcss
) - Tailwind Intellisense. - TS Error Translator (
mattpocock.ts-error-transation
) - gives hints about TypeScript and better error messages.
- Angular Language Service (
-
settings.json
- Various settings I prefer for working in Angular. -
tasks.json
- I have a run option so that when you open this directory, it automatically startsng serve -o
. -
typescript.code-snippets
- Has two code snippets for creating Angular components.
ngc
- Create an Angular Componentngrc
- Create an Angular Component, using the content of your clipboard for the template for the component.
- Tailwind - forms, typography, autoprefixer, daisyui, postcss, tailwindcss
- Mock Service Workers (msw) - for creating test doubles for API access.
Create a directory, and in that directory:
npx degit hypertheorytraining/angular-starter
npm i
code .
There are three snippets in the .vscode
folder.
Create a new TypeScript source code file. In the file type ngc
and then hit TAB. Use your tab key to cycle through the placeholder prompts.
Sample Output:
import { Component, ChangeDetectionStrategy } from "@angular/core";
@Component({
selector: "app-new-component",
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [],
template: ``,
styles: ``,
})
export class NewComponent {}
Copy some template code into your clipboard. Create a new TypeScript source code file. In the file type ngrc
and then hit TAB. Use your tab key to cycle through the placeholder prompts.
Sample:
import { Component, ChangeDetectionStrategy } from "@angular/core";
@Component({
selector: "app-new-component",
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [],
template: `<p>Whole Lotta Stuff From the Clipboard</p>`,
styles: ``,
})
export class NewComponent {}
Create a new TypeScript source code file. In the file type ngfr
and then hit TAB. Use your tab key to cycle through the placeholder prompts.
import { Routes } from "@angular/router";
import { TodosComponent } from "./todos.component.ts";
export const TODOS_ROUTES: Routes = [
{
path: "",
component: TodosComponent,
children: [],
},
];