diff --git a/adev/src/llms.txt b/adev/src/llms.txt index 844631671612..74b0edbe889c 100644 --- a/adev/src/llms.txt +++ b/adev/src/llms.txt @@ -64,6 +64,7 @@ Angular — Deliver web apps with confidence 🚀 - [Setting up the HttpClient](https://angular.dev/guide/http/setup) - [Making requests](https://angular.dev/guide/http/making-requests) - [Intercepting requests](https://angular.dev/guide/http/interceptors) +- [Reactive data fetching with httpResource](https://angular.dev/guide/http/http-resource) - [Testing](https://angular.dev/guide/http/testing) ## Forms @@ -73,6 +74,10 @@ Angular — Deliver web apps with confidence 🚀 - [Template driven forms](https://angular.dev/guide/forms/template-driven-forms) - [Validate forms input](https://angular.dev/guide/forms/form-validation) - [Building dynamic forms](https://angular.dev/guide/forms/dynamic-forms) +- [Signal Forms](https://angular.dev/guide/forms/signals/overview) + +## Accessibility +- [Angular Aria overview](https://angular.dev/guide/aria/overview) ## Routing - [Routing overview](https://angular.dev/guide/routing) diff --git a/packages/core/resources/best-practices.md b/packages/core/resources/best-practices.md index 7165d9884012..d4b6ca72ba6b 100644 --- a/packages/core/resources/best-practices.md +++ b/packages/core/resources/best-practices.md @@ -10,6 +10,7 @@ You are an expert in TypeScript, Angular, and scalable web application developme - Always use standalone components over NgModules - Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v20+. +- Do NOT set `changeDetection: ChangeDetectionStrategy.OnPush` explicitly. `OnPush` is the default in Angular v22+. - Use signals for state management - Implement lazy loading for feature routes - Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead @@ -27,7 +28,8 @@ You are an expert in TypeScript, Angular, and scalable web application developme - Use `input()` and `output()` functions instead of decorators - Use `computed()` for derived state - Prefer inline templates for small components -- Prefer Reactive forms instead of Template-driven ones +- Prefer Signal Forms (`@angular/forms/signals`) for new forms. They are stable in Angular v22+ and provide signal-based state, type-safe field access, and schema-based validation +- When not using Signal Forms, prefer Reactive forms instead of Template-driven ones - Do NOT use `ngClass`, use `class` bindings instead - Do NOT use `ngStyle`, use `style` bindings instead - When using external templates/styles, use paths relative to the component TS file. @@ -50,4 +52,5 @@ You are an expert in TypeScript, Angular, and scalable web application developme - Design services around a single responsibility - Use the `providedIn: 'root'` option for singleton services +- Prefer the `@Service` decorator over `@Injectable({providedIn: 'root'})` for new singleton services (Angular v22+) - Use the `inject()` function instead of constructor injection