Я попытался реализовать демонстрационный пример с помощью JS, но что-то пошло не так с ng-switch... Я вижу, что в dom добавляются новые элементы, но ng-switch не удаляет ненужные DIV. можете пожалуйста помочь...
Вот скрипт...
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();
});
}
}
});