Angular Directives

•
1
•

Builds modern Angular directives with signals, host property bindings, and directive composition for reusable DOM behavior.

The Angular Directives skill provides expert guidance for implementing custom attribute, structural, and host directives in modern Angular (v20+). It emphasizes idiomatic patterns including signal-based inputs, effects, host property configurations over legacy decorators, document-level event listeners, and dynamic template outlets. Whether creating portals, lazy-rendered DOM nodes, accessible focus handlers, or modular behaviors using the Directive Composition API, this skill helps developers build clean, reactive, and reusable element enhancements.

主要功能

01Provides clear separation between native control flow (@if, @for) and custom structural directives
02Builds attribute directives using signal inputs, effects, and modern host property bindings
031 GitHub stars
04Leverages hostDirectives and the Directive Composition API to assemble component traits
05Implements structural directives for portals, overlays, and deferred DOM rendering
06Handles outside-click detection, keyboard shortcuts, and document-level events cleanly

使用场景

01Creating overlays, modals, and teleported elements using dynamic ViewContainerRef and portal directives
02Adding reusable UI behaviors like tooltips, click-outside dismissal, or keyboard shortcuts to elements
03Composing shared states like focus management, elevation, and disabled traits across design systems