Skip to content

Instantly share code, notes, and snippets.

@jimmont
Created May 3, 2014 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmont/c64aa6131760eedb6867 to your computer and use it in GitHub Desktop.
Save jimmont/c64aa6131760eedb6867 to your computer and use it in GitHub Desktop.
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