What is “ng-init” directive in AngularJS Applications ?

ng-init directive initializes an AngularJS Application data. It is used to put values to the variables to be used in the application. In following example, we’ll initialize an array of countries. We’re using JSON syntax to define array of countries.

Sample using “ng-init” directive
<div ng-app = “myApp” ng-init = “countries = [{locale:’en-US’,name:’India’}, {locale:’en-GB’,name:’USA’}, {locale:’en-FR’,name:’UK’}]“>

</div>