Angularjs Examples

AJS Examples

AngularJS Directives

Directive are core feature of AngularJS. In AngularJS, directive you can think as special type of attribute used in HTML DOM to perform specific operation. AngularJS ships with set of directives such as ng-repeat, ng-bind etc. All AngularJS directives prefixed with the ng namespace. AngularJS allow you to write your own directives for Angular to use. AngularJS directives has the ability to execute methods, define behavior, attach controllers and $scope objects, manipulate the DOM, and more.

In this tutorial you will see some of commonly used directives.

AngularJS ng-init

This directive is used to initializes an AngularJS Application data. This allow you to assign value to your scope variables.


AngularJS ng-init Example

See Live Example

AngularJS ng-bind

This directive is used to display value from model object define in model and set variable values.


AngularJS ng-bind Example

See Live Example

AngularJS ng-repeat

This directive is used to loop through a collection and creates new template for each item.


AngularJS ng-repeat Example

See Live Example