Calling a function when ng-repeat has finished Calling a function when ng-repeat has finished angularjs angularjs