angularjsangularjs-ng-repeatng-animate

How to highlight text moved from one object to another


Hi I've got a quick question - how to highlight item when I moved him with unshift/push from list of selects to another list?

For example change for color blue for 1 second.


Solution

  • Use the enter animation hook with the ng-repeat directive. For more information, see AngularJS ng-repeat Directive API Reference - Animations.

    CSS

    .animate-repeat.ng-enter {
      color: blue;
      transition: all 1s;
    }
    

    HTML

      <ul class="example-animate-container">
        <li class="animate-repeat" ng-repeat="friend in friends | filter:q as results">
          [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
        </li>
      </ul>
    

    The DEMO on PLNKR