Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
¿Dónde debo colocar infinite-scroll="loadMore()" infinite-scroll-distance="1"

Estoy tratando de implementar el desplazamiento infinito con ng-infinite-scroll

codigo html original

 <div id="topMain" ng-if="util.data.results.length > 0" class='txnResults'> <ts-result row="row" data-last-result="$last" data-result-section-values="util.data" ng-repeat="row in util.data.results track by $index"> </ts-result> <div more codes </div> </div>

Agregué 'infinite-scroll' y el siguiente código a mi controlador

 $scope.numberToDisplay = 10; $scope.loadMore = function () { alert("loadmore " + $scope.numberToDisplay) if ($scope.numberToDisplay + 5 < vm.data.results.length) { $scope.numberToDisplay += 5; } else { $scope.numberToDisplay = vm.data.results.length; } };

y cambió el código html a

 <div id="topMain" ng-if="util.data.results.length > 0" class='txnResults'> <ts-result row="row" data-last-result="$last" data-result-section-values="util.data" ng-repeat="row in test = (util.data.results |limitTo:numberToDisplay) track by $index"> </ts-result> <div more codes </div> </div>

entonces, ¿dónde debo llamar a loadMore()? Traté de seguir el código de muestra y <div infinite-scroll="loadMore()" infinite-scroll-distance="1"> pero se llamó a loadMore() en bucle hasta numberToDisplay = length antes de que se llenara la pantalla.

 <div id="topMain" ng-if="util.data.results.length > 0" class='txnResults'> <div infinite-scroll="loadMore()" infinite-scroll-distance="1"> <ts-result row="row" data-last-result="$last" data-result-section-values="util.data" ng-repeat="row in test = (util.data.results |limitTo:numberToDisplay) track by $index"> </ts-result> </div> <div more codes </div> </div>

¿Alguna idea? ¡Gracias!

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!