Tutorialsplane

AngularJs Directives Intro


AngularJs Directives : AngularJs Directives are extended html attributes used in angularJs.

AngularJs Directives

AngularJs Directives starts with ng- prefix.

There are following common directives in AngularJs

1. ng-app : Is used to initialize the application.
2. ng-init : Is used to initialize the application data.
3. ng-model : Is used to bind the value of HTML with the application data.

Let us understand with simple example

Example 1




    



<div ng-app="" ng-init="myArr=['First Item','Second Item']">
    
    
    <p> {{myArr[0] + " , " +myArr[1]}}</p>

</div>


Try it Ā»

Tutorial

Expressions

AngularJs Directives

Controllers

AngularJs Filters

Http Methods

AngularJs Tables

Events

AngularJs Modules