Use ngSwitch, not ngShow / ngHide:
<span ng-switch="fooTime">
<span ng-switch-when="true">foo</span>
<span ng-switch-when="false">bar</span>
</span>
Why?
When using separate ngShow / ngHides, each element gets a separate $ watch, which runs asynchronously, leaving the potential for a break between events. With ngSwitch, only one $ watch is set, so they must display at the same time.
How do I get to ngSwitch?
, , , CSS :
<style>
[first] .fooTime {
display: inline;
}
[second] .fooTime, [first] {
display: none;
}
</style>
<span ng-class="{'fooTime':fooTime}">
<span first>foo</span>
<span second>bar</span>
</span>
ngSwitch .
:
, ngSwitch , , ngAnimate, 2 . .