This blog is in continuation with my previous introductory blog on angularJs, in this blog I will discuss about directives in angularJs.
In angularJs "Directives" are used to extend the functionality of a HTML static document by binding data to HTML with some expressions..
We can use it in two ways either we can define our own directory or we can use the set of built-in directives.
ng-app,ng-init,ng-model etc are built-in directives of angularjs.
Here's an example of angularjs using directive code:
In this example we had used few angularjs built-in directives
1)ng-app directive is used to initialise an AngularJS application.
2) ng-init directive is used to initialise application data.
3) ng-model directive is used to bind any html control's value to an application data.
4) ng-bind directive is used to bind an application data to the HTML view.
Note: Must inclue this link in your document when you are using angularjs.