commonModule.directive('animationEnd', function () { return { restrict: 'A', scope: { animationEnd: '&' }, link: function(scope, element) { var events = 'animationend webkitAnimationEnd'; element.on(events, function (event) { if (_.isFunction(scope.animationEnd)) { scope.animationEnd({ '$event': event }); } }); } }; });