in Angular, I need to call a function after an element with certain class has been loaded. Display of the element is controlled via ng-if=\'expr\'. Value of $scope.expr is set a
Problem was that there is no way to know if angular is done with the digest loop, ensuring that all elements have been rendered.
To solve this issue, there were two options
setTimeOut(function(){ ... }, 0);
as browsers by default keep all events in a queue, therefore, when digest loop is running, your callback function will enter the queue and get executed as soon digest loop is over.