description: Modern Angular conventions (standalone, signals, official style guide) globs: ["/*.ts", "/*.html"] alwaysApply: true
- Components are standalone by default; add them to another component's
imports. Don't setstandalone: false. - File names use hyphens; component
.ts/.html/.cssshare a base name and directory. Tests end.spec.tsnext to the code. - Organise by feature, not file type. Avoid generic names (
helpers.ts,utils.ts,common.ts). One concept per file. - Prefer
inject()over constructor parameter injection. - Group Angular members (deps, inputs, outputs, queries) near the top, then methods. Mark Angular-set props
readonly; useprotectedfor template-only members. - Inputs via
input()/input.required(), outputs viaoutput(), two-way viamodel(). - State:
signal()writable,computed()derived/read-only (never.set()),effect()only for side effects (don't write signals inside). - Templates use
@if/@for(mandatorytrack) /@switch— not*ngIf/*ngFor/*ngSwitch. - Bind classes/styles with
[class.x]/[style.prop], notNgClass/NgStyle. - Name event handlers by action (
saveUserData()), not event (handleClick()). - Keep lifecycle hooks short and
implementtheir interface; keep components presentation-focused.