Search code examples
animationangularng-animateng-class

Animate Between Classes Angular 2


Is there an Angular 2 way to animate between classes?

<div class="home-carousel-head" id="full-screen-carousel" [ngClass]="{tab_one: tab_one, tab_two: tab_two, tab_three: tab_three}">

I want to fade out or fade in when the class changes between each tab, this was easy with Angular 1 and ng-animate but I am not seeing this functionality with Angular 2. What is the best practice in Angular 2 to accomplish this?


Solution

  • The Angular animation module is about to be shipped. Currently you can use CSS animation. Fade-in/fade-out should be quite easy using CSS alone.