What is use of ng-init directive in angular
ng-init directive initializes AngularJS application variables. We will use ng-init to initializes some values. We can alse use data-ng-, inplace of ng-, if we need to make our page HTML valid.
Below is the syntax to use ng-init:-
< div data-ng-app="" data-ng-init="websitename='crackyourinterview'">
< p>The name is < span data-ng-bind="websitename"> < /span> < < /p>
< /div> | |