I modified the original ngAnimateSwap example this is found in the docs enter link description here to use a boolean expression instead of an integer to trigger the slide animation.
I would expect the banner to rotate between 'true' and 'false' however instead, only the 'true' appears, but the 'false' does not. From the angular docs: "ngAnimateSwap is a animation-oriented directive that allows for the container to be removed and entered in whenever the associated expression changes. " so I would have expected changing between true and false would cause the container to animate.
In the html:
<div class="container" ng-controller="AppCtrl">
<div ng-animate-swap="abool" class="cell swap-animation" ng-class="colorClass(abool)">
{{ abool }}
</div>
</div>
In the controller:
$scope.abool = false;
$interval(function() {
$scope.abool = !$scope.abool
}, 1000);
$scope.colorClass = function(abool) {
return abool ? 'red' : 'blue';
};
Here is the plunkr showing the example: http://plnkr.co/edit/iKE5BekgpxOqX1YE952Z?p=preview
As another test, if you update to my plunkr to change abool
to toggle between 1 and -1, then the animation looks as expected - sliding between 1 and -1.