It looks like you are looking for a way to be notified when ng-repeat is done with rendering the content. You can create a directive like this.
app.directive('ngRepeatEnd', function($rootScope){
return {
restrict:'A',
link:function(scope, element, attrs){
if(scope.$last){
$rootScope.$broadcast('ArrayUpdated');
}
}
};
});
Since the directive operates in the same scope as ng-repeat, you can access the $last
variable provided by ng-repeat. $last would be true for the last repeated value. So, with this, we can broadcast an event and catch it in the controller.
app.controller('DefaultController', function($scope){
$scope.$on('ArrayUpdated', function(){
//Your callback content here.
});
});