angular-frontend-patterns

Implements signal-first Angular component architecture with RxJS integration patterns.

Updated Jun 14, 2026
One-click install
npx skills add https://github.com/ironkid90-s/lucky5-v7 --skill angular-frontend-patterns-ironkid90-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-frontend-patterns
Source: https://github.com/ironkid90-s/lucky5-v7/tree/main/.ptah/skills/angular-frontend-patterns
Command: npx skills add https://github.com/ironkid90-s/lucky5-v7 --skill angular-frontend-patterns-ironkid90-s

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Modern Angular development requires choosing between signals and observables, structuring smart versus dumb components, and managing state without boilerplate-heavy libraries. This Skill provides concrete, copy-ready patterns for Angular 17+ so you avoid common pitfalls like setting signals inside effects or mishandling async streams. ## Core Features & Use Cases - Signal-First State Management: Patterns for signal(), computed(), input(), output(), and model() with read-only public state and private writable state. - Smart/Dumb Component Architecture: Container components that inject services and coordinate state, paired with OnPush presentational components that only receive inputs and emit outputs. - RxJS Interop Guidance: toSignal() and toObservable() conversion patterns for HTTP calls, debounced search, polling, and pagination. - Use Case: You are building an order management feature and need a list page with filters, sorting, and selection. Use the smart component pattern for the container, the dumb table pattern for rendering, and the pagination service pattern for data loading. ## Quick Start Ask the AI to build an Angular component using signal-based state management following the smart and dumb component patterns.

Frequently Asked Questions about angular-frontend-patterns

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

FAQPage Schema
How do I use signals in Angular components?

Use signal() for writable component state, computed() for derived read-only values, and input()/output() for component communication. Update signals with set() to replace values or update() to transform based on the current value.

When should I use signals vs observables in Angular?

Use signals for synchronous UI state, component inputs, and form values. Keep observables for continuous event streams like WebSockets, and convert HTTP responses to signals with toSignal() for template consumption.

How do I convert an observable to a signal in Angular?

Use toSignal() from @angular/core/rxjs-interop with an initialValue option. Combine with RxJS operators like debounceTime, switchMap, and catchError before conversion to handle loading and error states.

Can I set a signal inside an Angular effect?

Effects cannot write to signals by default and doing so is an anti-pattern. Use computed() for derived state instead; reserve effect() for logging, localStorage sync, DOM manipulation, and third-party library integration.

What is the smart and dumb component pattern in Angular?

Smart container components inject services, manage state, and handle routing, while dumb presentational components use OnPush change detection, receive data via input() signals, and emit user actions via output(). Dumb components never inject services or the router.

How do I handle debounced search with Angular signals?

Convert the search term signal to an observable with toObservable(), apply debounceTime and distinctUntilChanged, switchMap to the search service call, then convert back with toSignal(). This avoids writing signals inside effects.