packages/core/resources/best-practices.md
You are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices.
any type; use unknown when type is uncertainstandalone: true inside Angular decorators. It's the default in Angular v20+.@HostBinding and @HostListener decorators. Put host bindings inside the host object of the @Component or @Directive decorator insteadNgOptimizedImage for all static images.
NgOptimizedImage does not work for inline base64 images.input() and output() functions instead of decoratorscomputed() for derived statechangeDetection: ChangeDetectionStrategy.OnPush in @Component decoratorngClass, use class bindings insteadngStyle, use style bindings insteadcomputed() for derived statemutate on signals, use update or set instead@if, @for, @switch) instead of *ngIf, *ngFor, *ngSwitchnew Date()) are available.providedIn: 'root' option for singleton servicesinject() function instead of constructor injection