angular-components
/angular-components
Build standalone Angular components with Signals inputs, OnPush change detection, Control Flow, and Smart/Dumb patterns. Use when building standalone Angular components, implementing @if/@for control flow, applying OnPush change detection, or implementing Signals in Angular components.
- Author
- HoangNguyen0403 ↗
- Repository
- agent-skills-standard ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Build standalone Angular components with Signals inputs, OnPush change detection, Control Flow, and Smart/Dumb patterns. Use when building standalone Angular components, implementing @if/@for control flow, applying OnPush change detection, or implementing Signals in Angular components.
Original author description
Build standalone Angular components with Signals inputs, OnPush change detection, Control Flow, and Smart/Dumb patterns. Use when building standalone Angular components, implementing @if/@for control flow, applying OnPush change detection, or implementing Signals in Angular components.
How it works
- Priority: P0 (CRITICAL)
- Standalone & Structure
- Signals & Change Detection
- Control Flow
- Anti-Patterns
- References
- Canonical response anchors
SKILL.md preview
---
name: angular-components
description: Build standalone Angular components with Signals inputs, OnPush change detection, Control Flow, and Smart/Dumb patterns. Use when building standalone Angular components, implementing @if/@for control flow, applying OnPush change detection, or implementing Signals in Angular components.
metadata:
triggers:
files:
- '**/*.component.ts'
- '**/*.component.html'
keywords:
- angular component
- standalone
- input signal
- output
- "@if"
- "@for"
- ChangeDetectionStrategy
- OnPush
- Input
- Output
---
# Angular Components
## **Priority: P0 (CRITICAL)**
## Standalone & Structure
- **Standalone**: `standalone: true`. Import all deps in `imports` array. No NgModule. (Angular 20+: standalone default.)
- **Smart/Dumb Split**: **Smart (Container)** → inject services, manage state. **Presentational (Dumb)** → accept inputs and emit events via outputs only; no service dependencies.
- **Host Bindings**: Define in `host: { }` on `@Component` (e.g., `'[class.active]': 'isActive()'`) — never use @HostBinding/@HostListener.
- **View Encapsulation**: Default `Emulated`. Use `None` carefully.
## Signals & Change Detection
- **OnPush**: ALWAYS use `ChangeDetectionStrategy.OnPush`. No exceptions.
- **Signal Inputs**: `input.required<T>()` or `input<T>()` not `@Input()`. Access as functions: `{{ userId() }}`. Use `booleanAttribute`/`numberAttribute` transforms.
- **Signal Outputs**: `output<T>()` (v17.3+) not `@Output() EventEmitter`. Two-way binding: `model()`.
- **State**: `signal()` local, `computed()` derived, `effect()` side effects only.
- **Cleanup**: `toSignal()` (auto-unsubscribes), `takeUntilDestroyed()`, or `DestroyRef`. Never `subscribe()` without cleanup.
## Control Flow
- Use `@if (condition)`, `@for (item of items; track item.id)`, `@switch`, `@empty { }` instead of `*ngIf`/`*ngFor` (new control flow syntax, Angular 17+).
## Anti-Patterns
- **No default CD**: OnPush only — default re-checks every component every event.
- **No functions in templates**: `{{ calculate() }}` re-evaluates every cycle → `computed()` instead.
- **No manual subscribe**: `async` pipe or `toSignal`. Never `subscribe()` without cleanup.
- **No ElementRef mutation**: Directives or Renderer2.
- **No class inheritance**: Compose with Directives and Services.
## References
- [Standalone Pattern](references/standalone-pattern.md)
- [Control Flow](references/control-flow.md)
## Canonical response anchors
When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
- @empty { }
- Never use @HostBinding
- Signal inputs
- inputs and emit events via outputs
- Additional task-grounded exact anchors: @if (condition); @for (item of items; track item.id); booleanAttribute; model(); Smart (Container); toSignal()
Files in this package (4)
- SKILL.md 3 KB
- evals/evals.json 5 KB
- references/control-flow.md 1 KB
- references/standalone-pattern.md 1 KB
Versions
The database has no other skills named angular-components.
Database snapshot: 13.11.2026 · package version 47c758bba6e2 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 96angular-conventions
Modern Angular (v18+) coding standards — signals, standalone, OnPush, inject(), built-in control flow. Use when writing, refactoring or reviewing Angular code. - 100angular-idioms
Angular (19+) architecture: signals, standalone components, DI, OnPush change detection, and RxJS integration. Use when developing or refactoring Angular web apps. Pair with typescript-idioms. - 90angular-architecture
Use this skill when the user says 'Angular structure', 'Angular architecture', 'Angular folder', 'Angular standalone', 'Angular signals', 'Angular clean arch', 'Angular feature', 'Angular project layout', 'NgModule vs standalone', or when structuring an Angular application… - 100angular-modernize
Modernise an Angular application step by step: version-by-version upgrades with ng update, standalone components, signals and the new control flow, inject() function, typed reactive forms, OnPush change detection, and removal of deprecated modules, each through official… - 100angular
Use when building Angular applications. Covers standalone components, signals, RxJS discipline, change detection, dependency injection, and the patterns that keep large Angular codebases fast. Trigger on "subscription memory leak", "migrate to standalone components", "change… - 80Angular OnPush Host Bindings v18
Review OnPush components with host bindings after Angular 18 when host-bound state or external callbacks may not refresh as expected. Use when a bounded slice relies on ChangeDetectionStrategy.OnPush, host bindings, markForCheck, detectChanges, or manual refresh logic.