![]() |
VOOZH | about |
The ng-init Directive is used to initialize AngularJS Application data. It defines the initial value for an AngularJS application and assigns values to the variables. The ng-init directive defines initial values and variables for an AngularJS application.
Syntax:
<element ng-init = "expression"> ... </element>
Example: This example describes the ng-init Directive by initializing an array of strings.
Output:
Example 2: The example describes the ng-init Directive by specifying the object with its properties & associated value of it.
Output: