title: Angular ng-animate using javascript not working as expected
body: <p>I tried to implement the demo example using JS but something went wrong with ng-switch ... I can see that new elements are being added in the dom, but ng-switch is not removing the unwanted DIVs. can you pls help ...</p>
  
  <p>Here is the <strong><a href="http://jsfiddle.net/LFFav/9/" rel="nofollow">Fiddle...</a></strong></p>
  
  <pre><code>var ngModule = angular.module('myApp', []);
  ngModule.animation('js-wave-enter', function () {
  return {
      setup: function (element) {
          //prepare the element for animation
          element.css({ 'position': 'absolute', 'left': '100%' });
      },
      start: function (element, done, memo) {
          //start the animation
          element.animate({ 'left': 0  }, function () {
              //call when the animation is complete
              done();
          });
      }
  }
  });
  
  ngModule.animation('js-wave-leave', function () {
  return {
      setup: function (element) {
          //prepare the element for animation
          element.css({'position': 'absolute',  'left': 0     });           
      },
      start: function (element, done, memo) {
          //start the animation
          element.animate({ 'left': '-100%'      }, function () {
              //call when the animation is complete
              done();
          });
      }
  }
  });
  </code></pre>