javascript - AngularJS ng-infinite-scroll not working on a specific container/div -
i wrote code after reading multiple posts 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 didn't work. tried 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 doing wrong?
from answer in this thread, seems forgot double quotes:
the value of infinite-scroll-container in example is double-quoted class name .content wrapped single quotes. if read source, string value gets fed document.queryselector. can read documentation on see value expects.
without double quotes .course-enrollment-friends
passed in variable name, not string required.
so
infinite-scroll-container='".course-enrollment-friends"'
instead of
infinite-scroll-container='.course-enrollment-friends'
Comments
Post a Comment