场景:很多页,用户由上至下浏览。当浏览到底时,自动加载下一页。
如果使用 ng-repeat 简单的再次累加数据&编译,这个方案不是很好。每加载一次页面,需要编译所有的数据,并且浏览状态也会被重置。
直接操作 DOM append(node) ?
问一下,有没有朋友知道更好的方案,谢谢 ^_^
高洛峰2017-05-15 16:52:27
I found a plug-in with the keyword "Infinite scrolling", which is exactly what I need. The link is as follows:
http://binarymuse.github.io/ngInfiniteScroll/
After looking at it carefully, although this plan is good, it is not flexible enough for me.
Open the source code and understand it slightly after reading it. I did an evaluation and rewritten a directive from it which is more suitable for my current little thing ^_^
After understanding the implementation method, everything is easy to say