Question: what is ng-init in angular 2?
Answer: 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. ... Example: In this example, we initialize an array of string.