AngularJS lets you extend HTML with new attributes called Directives.
AngularJS has a set of built-in directives which offers functionality to your applications.
AngularJS also lets you define your own directives.
AngularJS Directives
AngularJS directives are extended HTML attributes with the prefix
ng-
.
The
ng-app
directive initializes an AngularJS application.
The
ng-init
directive initializes application data.
The
ng-model
directive binds the value of HTML controls (input, select, textarea) to application data.
Read about all AngularJS directives in our AngularJS directive reference.
Example
<div ng-app="" ng-init="firstName='John'">
<p>Name: <input type="text" ng-model="firstName"></p>
<p>You wrote: {{ firstName }}</p>
</div>
The
ng-app
directive also tells AngularJS that the <div> element is the "owner" of the AngularJS application.
0 Comments
If you have any doubts,please let me know