html
<script src="angular.min.js"></script>
<script src="angular-animate.min.js"></script>
script
var app = angular.module('myApp', ['ngAnimate']);
html
<div ng-class="{'animate-class': isAnimated}"></div>
script
app.controller('myCtrl', function($scope) {
$scope.isAnimated = false;
});
html
<button ng-click="isAnimated = !isAnimated">Toggle Animation</button>
css
.animate-class {
transition: all 1s;
background-color: red;
}