角UI> UI-utils的> UI滚动不起作用(诉0.1.0) [英] angular-ui > ui-utils > ui-scroll does not work (v. 0.1.0)
问题描述
我使用这个: http://angular-ui.github.io/ui- utils的/ 以及更具体的:的 https://github.com/angular-ui/ui-utils/blob/master/modules/scroll/README.md
I am using this: http://angular-ui.github.io/ui-utils/ and to be more specific this:https://github.com/angular-ui/ui-utils/blob/master/modules/scroll/README.md
但它似乎并没有工作。下面是一个例子:
however it does not seem to work. Here is an example:
<div ng-scroll-viewport style="height:240px;" class="chat-messages">
<div class="chat-message" ng-scroll="chat in chats">
<div ng-class="$index % 2 == 0? 'sender pull-right' : 'sender pull-left'">
<div class="icon">
<img src="{{chat.img}}" class="img-circle" alt="">
</div>
<div class="time">
{{chat.time}}
</div>
</div>
<div ng-class="$index % 2 == 0? 'chat-message-body on-left' : 'chat-message-body'">
<span class="arrow"></span>
<div class="sender"><a href="#">{{chat.name}}</a></div>
<div class="text">
{{chat.msg}}
</div>
</div>
</div>
</div>
但我在HTML中得到是这样的:
But All I get in HTML is this :
<div class="chat">
<div class="chat-messages" style="height:240px;" ng-scroll-viewport="">
<!--
ngScroll: chat in chats
-->
</div>
如果我更换NG滚动与NG重复,它完美的作品。但聊天需要滚动条,所以...我怎样才能得到呢? :)
If I replace ng-scroll with ng-repeat, it works perfectly. But chats need scroll bars, so... How can I get one? :)
推荐答案
得到一个滚动的方法之一是使用CSS,设置溢出-Y滚动,你会得到滚动条。
One way of getting a scroll is to use CSS, set overflow-y to scroll and you will get scroll bar.
如果您需要滚动至底部,与anchorScroll玩
http://docs.angularjs.org/api/ng 。$ anchorScroll。
If you need to scroll to the bottom, play with anchorScroll http://docs.angularjs.org/api/ng.$anchorScroll.
这篇关于角UI&GT; UI-utils的&GT; UI滚动不起作用(诉0.1.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!