angular-directives

Create and apply custom attribute, structural, and host directives in Angular v20+.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/TheSpiciestDev/com-userevals --skill angular-directives-thespiciestdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-directives
Source: https://github.com/TheSpiciestDev/com-userevals/tree/main/.agents/skills/angular-directives
Command: npx skills add https://github.com/TheSpiciestDev/com-userevals --skill angular-directives-thespiciestdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides reusable logic for manipulating the DOM, enhancing component behavior, and composing features directly within Angular templates, reducing boilerplate code.

Core Features & Use Cases

  • Attribute Directives: Modify element appearance or behavior (e.g., highlighting, tooltips).
  • Structural Directives: Control DOM structure (e.g., portals, lazy rendering).
  • Host Directives: Compose reusable behaviors onto components or other directives.
  • Use Case: Create a custom appTooltip directive to easily add hover-over information to any element, or a appLazyLoad directive to defer loading images until they are visible in the viewport.

Quick Start

Create a new attribute directive named 'appHighlight' that changes the background color of an element to yellow.

Frequently Asked Questions about angular-directives

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

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

To create custom Angular directives for DOM manipulation, you can build attribute directives to modify element appearance or structural directives to dynamically insert content. This approach enables reusable UI logic and declarative template enhancement.

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

Attribute directives in Angular modify element appearance or behavior, such as applying highlighting or tooltips. Structural directives control DOM structure by dynamically inserting or removing content, enabling features like lazy rendering or portals.

Does this directive approach work with Angular v20 and above?

Yes, this custom directive approach is designed for Angular v20 and above. It supports advanced DOM manipulation, behavior extension, and host directives for composing reusable behaviors directly onto components.

How do I compose reusable behaviors onto Angular components?

You can compose reusable behaviors onto Angular components by using host directives. This allows you to attach multiple directive behaviors to a single component or other directives declaratively, reducing boilerplate code.

What's the best way to add a tooltip or lazy loading to Angular UI elements?

The best way to add tooltips or lazy loading in Angular is by creating custom attribute directives like appTooltip for hover information or appLazyLoad to defer image loading until visible in the viewport.