Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
transitionEnd attribute directive
/*
element{transition:height 500ms ease-out;height:10px;}
element.change{height:200px;}
<element transition-end="endTransition($event)"></element>
$scope.endTransition = function(e){ }
*/
.directive('transitionEnd', function($parse){
return {
restrict: 'A'
,link: function(scope,elem,attr){
var expr = $parse(attr.transitionEnd);
elem.on('transitionend',function(event){
scope.$apply(function(){
expr(scope, {$event:event});
});
});
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.