Question

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>
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top