angular-directives

Create reusable Angular v20 directives for DOM manipulation and behavior composition.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/pkoka888/server-infra-templates --skill angular-directives-pkoka888
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-directives
Source: https://github.com/pkoka888/server-infra-templates/tree/main/.kilo/skills/marketplace/angular-directives
Command: npx skills add https://github.com/pkoka888/server-infra-templates --skill angular-directives-pkoka888

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Encapsulates DOM manipulation, UI behavior, and composition patterns into reusable Angular v20+ directives so teams avoid duplicated imperative code, improve accessibility, and simplify testing and maintenance.

Core Features & Use Cases

  • Attribute Directives: Modify element appearance, class and style toggles, disabled/aria attributes, and event wiring for buttons, inputs, and interactive controls.
  • Structural & Portal Patterns: Provide portals, lazy render, template outlets, and conditional render strategies for overlays, modals, and dynamic insertion points.
  • Host Directives & Composition: Compose behaviors like focus, ripple, elevation, and disableable using hostDirectives, exportable APIs, and host bindings for clean component APIs.
  • Observers & Performance: Integrate IntersectionObserver, ResizeObserver, and efficient effect-driven updates for lazy loading, infinite scroll, and resize-aware UI.
  • Accessibility & Events: Keyboard shortcut handling, ARIA attribute management, and event outputs for robust, accessible interactive components.

Quick Start

Create an Angular v20 attribute directive that highlights an element with a configurable color and include a usage example.

Frequently Asked Questions about angular-directives

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

FAQPage Schema
How do I create reusable Angular directives for DOM manipulation?

To create reusable Angular directives for DOM manipulation, build attribute directives that encapsulate class toggles, aria attributes, and event wiring. This approach eliminates duplicated imperative code and simplifies testing across interactive controls.

How do host directives work for composing behaviors in Angular v20+?

Host directives in Angular v20+ work by composing multiple behaviors like focus, ripple, and elevation into a single component API. Using hostDirectives with exportable APIs and host bindings ensures clean, maintainable UI behavior composition.

What is the best way to implement lazy loading and infinite scroll in Angular?

The best way to implement lazy loading and infinite scroll in Angular is by integrating IntersectionObserver within structural directives. This pattern provides efficient, effect-driven updates for conditional rendering and resize-aware UI without replacing native control-flow constructs.

Can I use TemplateRef and ViewContainerRef for dynamic portal overlays in Angular?

Yes, you can use TemplateRef and ViewContainerRef to create structural portal patterns for dynamic overlays and modals. These patterns support template outlets and conditional render strategies for dynamic insertion points within your Angular application.

Do I need Angular v20+ to use hostDirectives composition patterns?

Yes, you need Angular v20+ to use hostDirectives composition patterns. This Skill specifically targets Angular v20+ projects to support modern attribute directives, structural portals, lazy rendering, and host directive composition for component libraries.

Why should I avoid replacing native control-flow constructs with structural directives in Angular?

You should avoid replacing native control-flow constructs with structural directives to maintain predictable rendering behavior. Instead, structural portals and lazy render directives should complement native constructs by handling specific dynamic insertion points and overlay strategies.