angular-directives

Develop custom attribute, structural, and host directives in Angular.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/juhas96/ag-grid-test --skill angular-directives-juhas96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: angular-directives
Source: https://github.com/juhas96/ag-grid-test/tree/main/.opencode/skills/angular-directives
Command: npx skills add https://github.com/juhas96/ag-grid-test --skill angular-directives-juhas96

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to create reusable, declarative logic for DOM manipulation and behavior extension within Angular applications, reducing boilerplate and improving maintainability.

Core Features & Use Cases

  • Attribute Directives: Modify element appearance or behavior (e.g., highlighting, tooltips).
  • Structural Directives: Manipulate 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 ClickOutside directive to close a menu when clicking outside its bounds.

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 directives in Angular for DOM manipulation?

You can create custom Angular directives to handle DOM manipulation by developing attribute directives for element modification or structural directives for controlling DOM structure, reducing boilerplate.

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

Attribute directives modify element appearance or behavior like highlighting, while structural directives manipulate DOM structure like portals or lazy rendering to control layout composition.

How do I compose reusable behaviors across Angular components?

You can compose reusable behaviors across Angular components by using host directives to extend functionality and combine behaviors without duplicating component logic.

Can I add hover-over tooltips to elements using Angular directives?

Yes, you can create a custom appTooltip directive to add hover-over information to any element, extending element functionality declaratively within Angular applications.

What is the best way to close a menu when clicking outside its bounds in Angular?

Creating a custom ClickOutside directive provides reusable, declarative logic to close a menu when clicking outside its bounds, extending DOM behavior efficiently in Angular.