2

I have below statement,

    <div class="container" ng-controller = "SampleController" ng-init = "init()" >

in addition to the above div, I have anchor tags as below

    <a class="sampleclass">a1</a>
    <a class="sampleclass">a2</a>
    <a class="sampleclass">a3</a>

and in my example controller, I have defined my init function as below:

     $scope.init = function(){


        $('.sampleclass').attr('href','#');

    };

Will my init function get called when the entire dom gets loaded or quickly get called just after the first div gets loaded(the which triggered the init function)

Thanks, Balaji

balaji
  • 774
  • 1
  • 16
  • 42
  • 1
    possible duplicate of [Angular : ng-init does not run on load](http://stackoverflow.com/questions/24694908/angular-ng-init-does-not-run-on-load) – Satpal Sep 22 '15 at 11:17
  • You can also refer http://stackoverflow.com/questions/16150289/running-angularjs-initialization-code-when-view-is-loaded – Satpal Sep 22 '15 at 11:18

0 Answers0