Angular components

From FabianGosebrink/dog-rate-app · View interactive version

Angular components is an AI agent skill from the GitHub repository FabianGosebrink/dog-rate-app. Use when writing or editing an Angular component in this workspace — presentational (ui) or container components. Covers the clean component rules: dumb ui components, thin containers, and where logic must not go.

How to use this skill

Skill file

Angular components — dumb ui, thin containers, logic in stores

Components hold no logic. They bind signals and forward events. Every decision —

data shaping, calculations, navigation, add versus update — lives in a store (see the

state-management skill), never in a component class or template.

Presentational (`*/ui`) components

Dumb by construction:

decorators.

emits via its outputs. SingleDogComponent (dog in, dogDeleted out) and

DogRateComponent (currentDog in, rated/skipped out) are the reference dumb components.

DecimalPipe / DatePipe in the template rather than computing in the class).

output() — the container store decides what to do with it. Reference: DogFormComponent.

Container (`*/feature`) components

Thin wiring only:

bind its signals into the template, and forward child outputs to store methods or events.

Reference: MyDogsComponent, MainDogComponent, DogDetailComponent, AddDogComponent.

for), but the store keeps the resolved plain value, never the signal. DogDetailComponent

binds the route param with dogId = input('') and calls

store.loadSingleDogIfNotLoaded(this.dogId); DogDetailsStore stores dogId: string | null.

Forms

A form is UI, so it lives entirely in the presentational component; what happens after

submit is store work. The form and the store never reference each other.

from @angular/forms/signals): the form model, its validators, the photo handling, and the

submit guard all live in the ui component. On a valid submit it emits the payload via an

output() and does nothing else. It imports domain models only — never a store or a

service. Reference: DogFormComponent, which emits an AddedDogPayload through its

dogAdded output.

success notification, and navigation. Reference: AddDogStore.addDogWithPicture, wired up by

AddDogComponent.

(submit payload out).** The store does not know the form exists; the form does not know a

store exists.

Everywhere

The dogs feature is the reference example. See also the state-management and

angular-signals skills.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.