angular-directives

Create reusable Angular directives for DOM manipulation and behavior extension.

595|69|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/analogjs/angular-skills --skill angular-directives-analogjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-directives
Source: https://github.com/analogjs/angular-skills/tree/main/skills/angular-directives
Command: npx skills add https://github.com/analogjs/angular-skills --skill angular-directives-analogjs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers repeatedly implement similar directives to extend DOM behavior and appearance; this Skill provides a structured approach to building reusable Angular directive patterns for v20+ components.

Core Features & Use Cases

  • Attribute directives for modifying element appearance and behavior.
  • Structural directives for portals and overlays.
  • Host directives to compose multiple behaviors on a component.
  • Use Case: Create a reusable focus or tooltip pattern that can be shared across components with a consistent API.

Quick Start

Create a simple directive example using appHighlight to apply a background color to an element and observe the result in your template.

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 behavior?

To create reusable Angular directives for DOM behavior, use attribute directives to modify element appearance and structural directives for portals or overlays, leveraging Angular decorators and dependency injection to share patterns like focus or tooltip across components.

What is the difference between structural and attribute directives in Angular?

Attribute directives in Angular modify element appearance and behavior directly, while structural directives manipulate DOM layout by adding or removing elements, commonly used for managing portals and overlay rendering in component templates.

How do I use host directives to compose behaviors in Angular v20+?

Use host directives in Angular v20+ to compose multiple behaviors on a single component by applying the directive composition API, allowing you to combine features like tooltip and focus patterns without repeating code.

Can I use Angular signals when building custom directives?

Yes, you can use Angular signals when building custom directives to manage reactive state, enabling dynamic updates to element appearance or behavior through dependency injection in Angular v20+ projects.

What is the best way to build a tooltip or focus directive pattern in Angular?

The best way to build tooltip or focus directive patterns in Angular is to create attribute directives with a consistent API, using dependency injection to share the reusable behavior across multiple components.

Do I need to know the directive composition API to use host directives?

Yes, implementing host directives requires knowledge of the directive composition API in Angular v20+ to properly compose multiple feature behaviors onto a single component host element.