Exploring Attribute Directives in Angular

Attribute Directives are used to change the behavior, appearance or look of an element on a user input or via data from the service. Essentially, there are three types of directives in Angular:

  1. Component
  2. Structural directives
  3. Attribute directives


In this post, we will learn how to create Attribute Directives in Angular . So let’s say we want to change the background color of an element; in that case we would apply the attribute directive to the element.

Create first Attribute directive

Let’s start with creating the Attribute Directive. To do this, we need to create a class and decorate it with @directive decorators. A simple attribute directive to change the color of an element can be created as shown in the next listing:

Read full post on Infragistics blog


Deep Dive Directives in AngularJS – Infragistics webinar on 29th May at 3 PM IST


Infragistics is on the mission to make the developers better worldwide and to do the same, Infragistics is happy to host one more webinar for the developers in the India time zone on the topic Deep Dive into Custom Directives in AngularJS

Webinar is on 29th May from 3 PM to 4 PM IST

Topic: Deep Dive into the custom directives in the AngularJS

Directives are one of the most important feature of AngularJS 1.X. Using the directives either we create new element on the view or give special meaning to the existing elements. There are many built in directives are provided us to use as it is. For example ng-app, ng-repeat, ng-controller, ng-show etc. AngularJS provided directives mainly perform the following tasks,

  • Manipulate the DOM
  • Perform Data Binding
  • Attach specified behavior to DOM elements
  • Creates new DOM element
  • Handle events
  • Modify CSS
  • Validate data etc.

There would be scenario when you would write custom directives. In this webinar along with the AngularJS provided directives, we will deep dive into custom directives. We will cover following topics in the webinar,

  • Directives and usage of built in directives
  • Custom directives
  • Shared , Inherited and Isolated Scope in directives
  • Controller in directives
  • $complie and link function
  • Transclusion

To be a productive and efficient AngularJS developer one should have good understanding of the directives. In this webinar we will learn these topics related to the directives.

I am happy that I will be hosting the webinar. To join Register here