The ng-init directive is used to initialize an 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.
<element ng-init = "expression"> ... </element>
Example: In this example, we initialize an array of string.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.