Automatic scrolling of items with Angularjs

Asked

Viewed 51 times

0

I have a list of items, within a div, with the directive of angular ng-repeat. And I need to use an automatic scroll on that list, similar to this one DEMONSTRATION (is, uses jquery’s super-treadmill plugin). How can I do this with Angularjs (version 1.6)?

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

1 answer

0


I managed to solve by creating a 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.