I am trying to do what looks like a simple process: to display a list of items received from an HTTP request with animation.
First of all, here is my way of doing it ( I am open to any suggestions to do it in a better angular way ):
- I define a scope variable
state
that I initialize toloading
in my controller and that I change toloaded
when I receive data from the HTTP request. - I initialize a scope variable
items
with the received data. - In my view, I use
ng-switch
for the states, andng-repeat
with the items. - I define an animation with css on
ng-repeat
.
Here is a plunkr ( with a $timeout instead of the request ).
I cannot understand why the animation does not work.
Any help will be appreciated. Thanks.