LastTribunal LastTribunal - 1 year ago 47
AngularJS Question

Fade in effect for ng-repeat, for inserting elements at the top of a list

I've seen examples on how to fade in when adding elements to the bottom, but not to the top.

Answer Source

please find the code for app.js (from your sample link in you comment) below:

angular.module("userApp", ['ngAnimate'])
.controller('MainCtrl', function($scope) {
    $scope.usrList = [];
    $scope.adduser = function() {
        console.log($scope.newUsr)

        var item = {name: $scope.newUsr};
        $scope.usrList.splice(0, 0, item);
    }

});