← Tutti i modelli

Componenti standalone, signals per lo stato, template rigorosi, route lazy.

Constitution — Angular enterprise app

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Standalone components. Every component, directive and pipe is standalone and imports what it uses. No new NgModule is added.

  2. Signals for state. Component state uses signal, computed and input(). RxJS stays for streams of events and is turned into signals with toSignal; a manual subscribe without takeUntilDestroyed fails the review.

  3. Strict templates. strict and strictTemplates are on in tsconfig.json, so a type error in a template fails the build. No $any() in templates.

  4. Lazy routes. Every feature is loaded with loadComponent or loadChildren. The initial budget in angular.json is an error above 500 kB, so the build fails when it grows past it.

  5. OnPush everywhere. Every component uses ChangeDetectionStrategy.OnPush. A component that only works with default change detection is a defect.

  6. Dependencies through injection. Services are obtained with inject() and provided in root or in route providers. Creating a service with new fails the review.

  7. Typed reactive forms. Forms are typed FormGroup and FormControl with validators next to them. Untyped forms and template-driven forms for business data are not used.

  8. Tested and accessible. Components are tested through their template with Angular Testing Library, and the @angular-eslint/template accessibility rules run as errors. The suite is green before the merge.