AngularJS Tutorial 23 - Custom Directives

Опубликовано: 08 Октябрь 2024
на канале: Nisha Singla
1,680
25

In this session, we will be talking about Custom Directives in angularJS.

Directives are the markup on the DOM that allows you to attach some extra behavior on DOM

First we will discuss about why we need Custom Directives?
When html was first created it was never intended to use it the way we are using it today.

It was used to represent your static data but as the need of dynamic data increased we want Dynamic document.As our needs grew we start streching HTML to do more and more.

As our needs evolved, we found HTML more like a programming language rather than just a markup for creating static documents and you can see this in case of Web Components

Web Components is a adapt proposal of current W3C specifications and it allows you to create your own custom HTML elements with embedded functionality

So angular gives you this functionality of creating these web components with the help of Directives

Syntax
moduleName.directive("DirectiveName", function(){

return {

}
});


Kindly click on this click if you want to learn about Directives

   • AngularJS Tutorial 3 - Directives  


Connect with me on my Facebook page

  / angularjs4beginn