Angular
Overview
Angular is a full-featured, opinionated TypeScript framework and platform for building web applications, with a first-class CLI, dependency injection, routing, forms, and HTTP client included. Modern Angular uses standalone components and signals for reactivity. Read this when scaffolding with the Angular CLI, structuring components/services, or working with DI and signals.
Official sources
Install / setup
Install the CLI globally and create a project (copied verbatim from angular.dev/installation):
npm install -g @angular/cli
ng new <project-name>
Core concepts
- Components — classes with a template and styles, declared standalone in modern Angular.
- Templates — HTML with Angular syntax: bindings (
[prop], (event)), control flow (@if, @for), and interpolation.
- Signals — reactive primitives (
signal, computed, effect) for fine-grained state.
- Dependency injection — services are provided and injected via the DI system (
inject() / constructor injection).
- Angular CLI —
ng generate, ng serve, ng build scaffold, run, and bundle apps.
- Routing — the Router maps URL paths to components.
- RxJS — Observables power async streams (HTTP, events) throughout the framework.
Best practices
- Prefer standalone components and the new control-flow syntax (
@if, @for) for new code.
- Use signals for component state and
computed for derived values.
- Use the CLI (
ng generate) to scaffold consistent components, services, and routes.
- Provide services at the appropriate injector scope (root vs. component) to control lifetimes.
- Keep templates declarative; move logic into the component class or services.
Common pitfalls
- Forgetting to unsubscribe from long-lived Observables → use
async pipe or takeUntilDestroyed to avoid leaks.
- Doing heavy work in templates → precompute with
computed/signals or pure pipes.
- Mixing NgModules and standalone patterns inconsistently → follow the standalone-first guidance for new projects.
Examples
import { Component, signal } from '@angular/core';
@Component({
selector: 'app-counter',
standalone: true,
template: `<button (click)="count.set(count() + 1)">Clicked {{ count() }} times</button>`,
})
export class CounterComponent {
count = signal(0);
}
Further reading
Related skills
- ../react — component UI library
- ../vue — progressive reactive framework
1---2name: angular3description: Full-featured TypeScript frontend platform with CLI, DI, and reactive primitives; consult for components, signals, and Angular CLI apps.4domain: stack5category: frontend6tags: [angular, typescript, cli, signals, dependency-injection, spa]7official_sources:8 - https://angular.dev/9 - https://github.com/angular/angular10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/angular13---1415# Angular1617## Overview18Angular is a full-featured, opinionated TypeScript framework and platform for building web applications, with a first-class CLI, dependency injection, routing, forms, and HTTP client included. Modern Angular uses standalone components and signals for reactivity. Read this when scaffolding with the Angular CLI, structuring components/services, or working with DI and signals.1920## Official sources21- Docs: https://angular.dev/22- Repo: https://github.com/angular/angular23- Install / download: https://angular.dev/installation2425## Install / setup26Install the CLI globally and create a project (copied verbatim from angular.dev/installation):2728```bash29npm install -g @angular/cli30```3132```bash33ng new <project-name>34```3536## Core concepts37- **Components** — classes with a template and styles, declared standalone in modern Angular.38- **Templates** — HTML with Angular syntax: bindings (`[prop]`, `(event)`), control flow (`@if`, `@for`), and interpolation.39- **Signals** — reactive primitives (`signal`, `computed`, `effect`) for fine-grained state.40- **Dependency injection** — services are provided and injected via the DI system (`inject()` / constructor injection).41- **Angular CLI** — `ng generate`, `ng serve`, `ng build` scaffold, run, and bundle apps.42- **Routing** — the Router maps URL paths to components.43- **RxJS** — Observables power async streams (HTTP, events) throughout the framework.4445## Best practices46- Prefer standalone components and the new control-flow syntax (`@if`, `@for`) for new code.47- Use signals for component state and `computed` for derived values.48- Use the CLI (`ng generate`) to scaffold consistent components, services, and routes.49- Provide services at the appropriate injector scope (root vs. component) to control lifetimes.50- Keep templates declarative; move logic into the component class or services.5152## Common pitfalls53- Forgetting to unsubscribe from long-lived Observables → use `async` pipe or `takeUntilDestroyed` to avoid leaks.54- Doing heavy work in templates → precompute with `computed`/signals or pure pipes.55- Mixing NgModules and standalone patterns inconsistently → follow the standalone-first guidance for new projects.5657## Examples58```typescript59import { Component, signal } from '@angular/core';6061@Component({62 selector: 'app-counter',63 standalone: true,64 template: `<button (click)="count.set(count() + 1)">Clicked {{ count() }} times</button>`,65})66export class CounterComponent {67 count = signal(0);68}69```7071## Further reading72- https://angular.dev/overview — platform overview and guides73- https://angular.dev/tools/cli — Angular CLI reference7475## Related skills76- ../react — component UI library77- ../vue — progressive reactive framework