search

Home  >  Q&A  >  body text

angular.js - How to automatically load the next page when angularjs is at the bottom

Scenario: Many pages, users browse from top to bottom. When browsing to the end, the next page is automatically loaded.

  1. If you use ng-repeat to simply accumulate data again & compile, this solution is not very good. Every time a page is loaded, all data needs to be compiled and the browsing state is reset.

  2. Directly operate DOM append(node)?

Ask if anyone knows a better solution, thank you ^_^

PHPzPHPz2776 days ago687

reply all(3)I'll reply

  • 高洛峰

    高洛峰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

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 16:52:27

    $scope.feedList = $scope.feedList.concat([ ... ])
    

    reply
    0
  • PHPz

    PHPz2017-05-15 16:52:27

    I think we should write a directive to monitor scroll

    reply
    0
  • Cancelreply