← ClaudeAtlas

angular-20-standalone-componentlisted

Create Angular 20 standalone components using modern patterns: Signals for state management, input()/output() functions (not decorators), @if/@for/@switch control flow (not *ngIf/*ngFor), inject() dependency injection (not constructor), and OnPush change detection. Use this skill when scaffolding new UI components that need reactive state, form handling, or integration with services following the three-layer architecture.
aiskillstore/marketplace · ★ 329 · Web & Frontend · score 82
Install: claude install-skill aiskillstore/marketplace
# Angular 20 Standalone Component Skill This skill helps create Angular 20 components following modern patterns and project standards. ## Core Principles ### Modern Angular 20 Patterns - **Standalone Components**: 100% standalone, zero NgModules - **Signals**: Use `signal()`, `computed()`, `effect()` for state - **New Syntax**: `input()`, `output()`, `@if`, `@for`, `@switch` - **inject()**: Function-based dependency injection - **OnPush**: Change detection strategy for performance ### Architecture Integration - **Presentation Layer**: Components handle UI only - **Service Integration**: Inject services for business logic - **No Direct Repository**: Never inject repositories directly - **Event-Driven**: Use EventBus for cross-module communication ## Component Template ```typescript import { Component, signal, computed, effect, input, output, inject, ChangeDetectionStrategy } from '@angular/core'; import { SHARED_IMPORTS } from '@shared'; import { YourService } from '@core/services/your.service'; @Component({ selector: 'app-your-component', standalone: true, imports: [SHARED_IMPORTS], changeDetection: ChangeDetectionStrategy.OnPush, template: ` <div class="component-container"> @if (loading()) { <nz-spin nzSimple /> } @else if (hasError()) { <nz-alert nzType="error" [nzMessage]="errorMessage()!" nzShowIcon /> } @else { <div class="content"> @for (item of items(); tra