html
<div ng-class="{'enter': showElement, 'leave': !showElement}"></div>
css
.enter {
opacity: 1;
transition: opacity 0.5s;
}
.leave {
opacity: 0;
transition: opacity 0.5s;
}
script
angular.module('myApp', ['ngAnimate'])
.controller('myController', function($scope) {
$scope.showElement = false;
$scope.toggleElement = function() {
$scope.showElement = !$scope.showElement;
};
});