I want to achieve a smooth resorting of elements in an ng-repeat. I have this code but it results in 2 odd behaviours:
- The elements are only animating vertically downwards
- The elements are only animating if I change the model.countryData within the interval of the CSS transition (i.e. after 2 consecutive and quick changes)
ng-repeat
<div ng-repeat="country in model.countryData" class="repeat-animation" ng-style="{ 'top' : yPos($index) }" style="position: absolute; left: 0px;">
{{ country.name }}
</div>
CSS
.repeat-animation.ng-enter,
.repeat-animation.ng-leave,
.repeat-animation.ng-move {
-webkit-transition: all linear 2s;
-moz-transition: all linear 2s;
-o-transition: all linear 2s;
transition: all linear 2s;
}
I suspect this could be related to how I sort the underlying data and/or version issues with angular animate and/or faulty CSS syntax?
All help appreciated!