AngularJS directives are the extension of HTML attributes by using ng-.
The main used directives are:-
- The ng-init directive is used to initialize.
- The ng-app directive defines an AngularJS application. It also tells that the current element is the owner of the application.
- The ng-model directive binds the value of HTML controls.
- The ng-bind directive binds application data to the HTML view.
- The ng-repeat directive is used to repeat. It is used on arrays of objects
The ng-app directive is used to define the root element. It will be automatically initialized when the web page is loaded.
< element ng-app="module_name" >
// AngularJS Code goes here
< /element >
|module_name||Optional. Defines the name of a module to load with the application|
The ng-init directive is used to define the initial values for the application.
< element ng-init="expression" >< /element >
|expression||An expression to evaluate.|
The ng-model directive is used to bind with HTML Controls. It can also be used for type validation, status for the applicatiion.
< element ng-model="name" >< /element >
|name||The name of the property you want to bind to the form field.|