Note that there are some explanatory texts on larger screens.

plurals
  1. POngAnimate, addClass callback doesn't run after animation ended
    text
    copied!<p>I dont understand why the callback gets called right away, without any delay, i've read the doc it says that it parses the css to retrieve the transition duration.</p> <p>but it doesn't seem to work, here is my code :</p> <p>this is my slide directive :</p> <pre><code>'use strict' class SlideController constructor: ($log, $scope) -&gt; console.log 'controller init.' class Slide constructor: ($log,$animate) -&gt; link = (scope, element, attrs) =&gt; scope.$watch 'slide.animation', (newValue,oldValue)-&gt; $animate.addClass element,'enter-right',()-&gt; console.log 'Animation ended!' return { link controller: ['$log', '$scope', SlideController] replace: true restrict: 'E' scope: slide: '=' templateUrl: '/views/directives/postSlide.html' transclude: true } angular.module('app').directive 'postSlide', ['$log','$animate', Slide] </code></pre> <p>and here is my css :</p> <pre><code>.post-slide.enter-left, .post-slide.leave-left, .post-slide.enter-right, .post-slide.leave-right{ position:absolute; left:0px; top:0px; } /** Enter/leave right **/ .post-slide.enter-right { -webkit-animation:0.5s enter-right; animation:0.5s enter-right; z-index:100; background-color:darkgreen; } .post-slide.leave-right { -webkit-animation:0.5s leave-right; animation:0.5s leave-right; z-index:10; background-color:darkred; } @keyframes enter-right { from { left:100%; } to { left:0; } } @-webkit-keyframes enter-right { from { left:100%; } to { left:0; } } @keyframes leave-right { from { left:0; } to { left:-100%; } } @-webkit-keyframes leave-right { from { left:0; } to { left:-100%; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload