Another approach:
http://jsfiddle.net/coma/UxcxP/2/
HTML
<section ng-app> <div ng-class="{foo:true}"></div> </section>
CSS
div { width: 100px; height: 100px; background-color: red; opacity: 0; -moz-transition: opacity 0.5s ease; -o-transition: opacity 0.5s ease; -webkit-transition: opacity 0.5s ease; transition: opacity 0.5s ease; } div.foo { opacity: 1; }
This will work like a cloak, since Angular will not set the class foo until it is loaded.
The cloak will not work the way you want, because it will be there (as a class, attribute, element ...) until Angular replaces it with the result of the template process, so this is not the same node and why it will not receive the transition (the transition occurs when the same element changes), does not change, it is simply not the same node.
Take a look at this:
http://jsfiddle.net/coma/UxcxP/5/
As you can see in this example, the div next to the one that is "angular" gets a fade animation because it has the same div even before Angular.
source share