Angular : ng-init does not run on load
问题 I have seen a few exmaples on stack overflow about this ng-init issue, although I cant seem to find one which references it with the use of a controller. I have called the function in the controller by having the following in the html file <div class="tab-container" ng-controller = "ExampleController" ng-init = "init()" > In the controller: $scope.init = function(){ alert("do something"); }; It does run, but it runs before the components have loaded on the screen. Am i missing something?