0

I wrote this code after reading multiple posts about ng-infinite-scroll

<div class="course-enrollment-friends" ng-class="{'friends-paginated':showMoreFriends}">
    <div class="row" id="enrollment-friends" ng-show="!noFriends">
        <div
         infinite-scroll="enrollCtrl.retYearAndSem()"
         infinite-scroll-disabled='!{{showMoreFriends}}'
         infinite-scroll-parent='true'>
            <div class="col-md-2" ng-repeat="friend in friends" style="margin-bottom:10px;">

However this didn't work. So I tried something slightly different

<div class="course-enrollment-friends" ng-class="{'friends-paginated':showMoreFriends}">
    <div class="row" id="enrollment-friends" ng-show="!noFriends">
        <div
         infinite-scroll="enrollCtrl.retYearAndSem()"
         infinite-scroll-disabled='!{{showMoreFriends}}'
         infinite-scroll-container='.course-enrollment-friends'>
            <div class="col-md-2" ng-repeat="friend in friends" style="margin-bottom:10px;">

What am I doing wrong?

2
  • I can't find any reference to infinite-scroll-container='.course-enrollment-friends' in the docs. Where's that from? Commented Jul 14, 2015 at 7:44
  • stackoverflow.com/a/28521884/5088332 Commented Jul 14, 2015 at 7:51

2 Answers 2

0

From the answer in this thread, it seems you forgot the double quotes:

The value of infinite-scroll-container in this example is double-quoted class name .content then wrapped by single quotes. If you read the source, the string value eventually gets fed into document.querySelector. You can read the documentation on that to see what value it expects.

Without the double quotes .course-enrollment-friends is passed in as a variable name, not as a string as is required.

So

infinite-scroll-container='".course-enrollment-friends"'

instead of

infinite-scroll-container='.course-enrollment-friends'
Sign up to request clarification or add additional context in comments.

1 Comment

Hey, thanks for the reply. While I was hopeful that you caught the issue, it still didn't work... I'm guessing I'm doing something wrong with the divs somewhere
0

Try removing the braces around the value given in infinite-scroll-disabled. Use:

<div
     infinite-scroll="enrollCtrl.retYearAndSem()"
     infinite-scroll-disabled='!showMoreFriends'
     infinite-scroll-container='.course-enrollment-friends'>

instead of :

<div
     infinite-scroll="enrollCtrl.retYearAndSem()"
     infinite-scroll-disabled='!{{showMoreFriends}}'
     infinite-scroll-container='.course-enrollment-friends'>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.