3

I am having a hard time to figure out why the same piece of html is not working as it is working on other page. I am trying to call the function on scroll when it reaches the bottom of page , but it does not working like that. I scroll a little and there goes the call to api function.

        <div class="search_filter_wrape tss_accordion_wrapper" infinite-scroll='jobPosting.loadMoreData()'
         infinite-scroll-disabled='jobPosting.paused()'>
       <div ng-repeat="jobPanel in jobPosting.jobs">
           <h1 style="color:red">Hi</h1>
       </div>
    </div>

controller.js

jobPosting.loadingData = false;

 function loadMoreData() {

 if(jobPosting.loadingData) return;
 jobPosting.loadingData = true;

  api{
     // .......
     jobPosting.loadingData = false
     }
    }
 function paused() {
        // set this bit before call and after response
        return jobPosting.loadingData;
    }

Now whats wrong with this ?

Usman I
  • 1,898
  • 4
  • 20
  • 39
  • i dont know man i am new to angular.\ – Usman I Dec 27 '17 at 11:11
  • please see this http://sroze.github.io/ngInfiniteScroll/demo_async.html – Usman I Dec 27 '17 at 11:12
  • the template is same man. even the controller has same login just like I mentioned above, but the question is what on earth the function loadmore is being called? – Usman I Dec 27 '17 at 11:29
  • I solved it it was ng-show as I was including this in a template file which was being rendered in ng-show conditions. Always use ng-if **** – Usman I Dec 27 '17 at 13:19

0 Answers0