angular-21

Create standalone Angular 21 components using signals for reactive state management.

Updated Jun 22, 2024
One-click install
npx skills add https://github.com/KilloconQ/dotfiles --skill angular-21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-21
Source: https://github.com/KilloconQ/dotfiles/tree/main/opencode/.config/opencode/skills/angular-21
Command: npx skills add https://github.com/KilloconQ/dotfiles --skill angular-21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Angular developers often struggle to adopt modern patterns like Signals and standalone components, leading to boilerplate and inconsistent state management. This Skill teaches Angular 21 patterns to streamline component design and reactivity with signals, resource handling, and DI improvements.

Core Features & Use Cases

  • Signals for state management (signal, computed, effect, linkedSignal) to create reactive components without manual subscriptions.
  • Standalone components by default, eliminating the need for NgModules and simplifying component composition.
  • New control flow constructs (@if, @for, @switch, @defer) for streamlined templating and performance.
  • Signal-based inputs/outputs/queries (input, output, model, viewChild, inject) for type-safe, declarative APIs.
  • Resource API (resource, httpResource) for declarative async data fetching and reactive data handling.
  • Dependency injection with inject() in field initializers for tree-shakable, boilerplate-free DI.
  • OnPush change detection to maximize performance in reactive apps.

Quick Start

Create a standalone Angular 21 component using signals to manage state.

Quick Start Create a standalone Angular 21 component using signals to manage state.

Frequently Asked Questions about angular-21

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage state in Angular components using signals?

Angular signals provide reactive state management using signal, computed, effect, and linkedSignal to update component state without manual subscriptions. This approach eliminates boilerplate and ensures consistent reactivity across standalone components.

How do I fetch data declaratively in Angular 21?

You can fetch data declaratively in Angular 21 using the resource and httpResource APIs. These APIs handle asynchronous data fetching reactively, integrating seamlessly with signals to manage and display fetched data in components.

What is the best way to use dependency injection in standalone Angular components?

The best way to use dependency injection in standalone Angular components is the inject() function in field initializers. This method provides tree-shakable, boilerplate-free DI and works natively with standalone components without requiring NgModules.

How do I use OnPush change detection with signals in Angular?

You can use OnPush change detection with signals in Angular to maximize performance in reactive apps. Signals automatically notify the framework of state changes, allowing OnPush to efficiently update the DOM only when necessary.

What are the new control flow constructs in Angular templates?

The new control flow constructs in Angular templates are @if, @for, @switch, and @defer. These constructs replace older structural directives, streamlining templating and improving rendering performance in standalone components.