Question: I have a ng-repeat directive which displays a list of links. It works fine, but my code also has a javascript function which places the list depending on its dimensions. Naturally, the dimension of the list is not known until Angular is done databinding and modifying the DOM. If I call the function immediately after data change, then the placement calculation jumps the gun and places the list as if it's empty. I want to fire the function once Angular is done modifying the DOM. How can I do that?

**EDIT:**

Just tried ngcloak as a possible solution, unfortunately it does not work. Reading ngcloak's documentation, my problem is not that the list flickers, but it is placed as if it's empty, and then stays there. I need a way to call my function once the databinding is complete.

Answer: 
For anybody that stumbles upon this question looking for a way to execute a function after Angular is done updating the view because of data **changes** (not only after page load):

If you use `$timeout` with the timeout=0 (or omit the second argument - it's the default value), the code will be executed in the next digest cycle. 

```
$timeout(function(){
    /// your logic here
}, 0);

```

In the situation described in the question, this should be called in a custom directive, as described by @MikeDriver

**Why not probe angular's current phase?**

According to another SO answer, Angular's authors say that $phase should not be used -it is an internal mechanism and is not future-safe. 
<https://stackoverflow.com/a/21611534/1578982>
Obviously the $timeout way is also simpler.
I think [ngCloak](http://docs.angularjs.org/api/ng.directive%3angCloak) is what you are looking for.