Skillshub angular-components
Standards for Standalone Components, Signals inputs, and Control Flow. Use when building standalone Angular components or implementing @if/@for control flow. (triggers: **/*.component.ts, **/*.component.html, angular component, standalone, input signal, output, @if, @for)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/angular-components" ~/.claude/skills/comeonoliver-skillshub-angular-components && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/angular-components/SKILL.mdsource content
Angular Components
Priority: P0 (CRITICAL)
Principles
- Standalone:
. Import all dependencies directly instandalone: true
array. Do not declare in NgModule. (Angular 20+: standalone is the default —imports
is not needed.) Usestandalone: true
to scaffold automatically.ng generate c - Signal Inputs: Use
and input.required<T>() instead ofinput()
. Use booleanAttribute or@Input()
transforms where applicable (e.g.,numberAttribute
). Access value as a function: this.disabled().input(false, { transform: booleanAttribute }) - Signal Outputs: Use output<T>() (from v17.3+) instead of
. Emit with: this.selected.emit(value). For two-way binding use model() which creates a writable signal.@Output() EventEmitter - Control Flow: Use @if (condition), @for (item of items; track item.id), @switch, and @empty { } blocks inside @for for empty state instead of
,*ngIf
.*ngFor - Host Bindings: Define in the host: { } object on
(e.g.,@Component
,'[class.active]': 'isActive()'
) — Never use @HostBinding or @HostListener decorators.'(click)': 'onClick()' - View Encapsulation: Default
. UseEmulated
carefully.None
Signals Integration
- Use computed() for derived state and display values.
- Use
strictly for side effects (logging, manual DOM manipulation), NEVER for state propagation.effect() - Avoid logic in templates — move to
or component methods. Set ChangeDetectionStrategy.OnPush.computed()
Anti-Patterns
- No logic in template: Replace with
signals or component method calls.computed() - No ElementRef mutation: Encapsulate DOM changes in a Directive or use Renderer2.
- No class inheritance: Compose behavior using Directives and Services instead.