Erico Souza
Erico Souza

Reputation: 276

Automatic scrolling with angularJs

I have a list of items, inside a div, with a ng-repeat angular directive. And I need this list, to use an automatic scrolling, it's a DEMO (it's, use the jquery super-treadmill). How can I do this with angular js (version 1.6)?

<div class="panel-body">
    <div ng-repeat="model in collection">
        <h1>{{model.name}}</h1>
        <p>{{model.description}}</p>
    </div>
</div>

Upvotes: 0

Views: 839

Answers (1)

aseferov
aseferov

Reputation: 6393

you can do it with simple directive

app.directive('startTreadmill', function(){
     return {
         link: function(scope, element, attr){
              $(element).startTreadmill({ direction: "down"});
         }
     }
})


<div class="panel-body" start-treadmill>
    <div ng-repeat="model in collection">
        <h1>{{model.name}}</h1>
        <p>{{model.description}}</p>
    </div>
</div>

Upvotes: 1

Related Questions