---
title: "What are directives in AngularJS? Provide examples."  
description: "What are directives in AngularJS? Provide examples."  
author: "Sandra Emily"  
published: 2024-06-24  
updated: 2024-06-24  
canonical: https://www.mindstick.com/forum/160769/what-are-directives-in-angularjs-provide-examples  
category: "angular js"  
tags: ["web development", "angular js", "front-end development"]  
reading_time: 1 minute  

---

# What are directives in AngularJS? Provide examples.

What are directives in AngularJS? Provide examples.

## Replies

### Reply by Ravi Vishwakarma

[Directives in AngularJS](https://www.mindstick.com/blog/304177/explain-the-directive-in-angularjs) are special markers on a DOM element (such as an **attribute**, **element** name, **comment**, or **CSS class**) that tell AngularJS's HTML compiler to attach a specified behavior to that DOM element or even transform the DOM element and its children. Directives are one of the most powerful features of **AngularJS**, enabling developers to create new HTML tags, attributes, and CSS classes.

## Types of Directives

1. [**Built-in Directives:**](https://www.mindstick.com/articles/336201/directives-in-angularjs) AngularJS provides several built-in directives to extend HTML functionality.
2. [**Custom Directives**](https://www.mindstick.com/articles/336208/how-to-create-custom-directives-in-angularjs)**:** Developers can create their own custom directives to encapsulate reusable behaviors and components.


---

Original Source: https://www.mindstick.com/forum/160769/what-are-directives-in-angularjs-provide-examples

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
