Autoscroll down angularjs

user1424508 picture user1424508 · Nov 9, 2013 · Viewed 14.9k times · Source

Hi I'm creating a chat app with angularjs that autoscrolls down when a user messages another user. I'm not sure how to implement this as my chat window is a fixed ul element. I'm thinking I will need to implement a directive to do this (inboxmsg-scroll on the ul element)

Any help? thanks.

HTML

<ul class="chatting-window" inboxmsg-scroll>
    <li data-ng-repeat="messageinfo in messages">
        <div class="message-date">
            {{messageinfo[0]}}
        </div>
    </li>
</ul>

Answer

Răzvan Flavius Panda picture Răzvan Flavius Panda · Apr 11, 2014

angularjs-scroll-glue

An AngularJs directive that automatically scrolls to the bottom of an element on changes in it's scope.

Link: https://github.com/Luegg/angularjs-scroll-glue