Hi everybody !
I’m getting an issue on my app, ion-infinite-scroll on-infinite is never call.
I have a ion-infinite-scroll in two different pages of my app, on the first it is working on the second, ion-infinite-scroll on-infinite is never call.
Here is the code of the second page, where the ion-infinite-scroll on-infinite is never call.
<ion-view view-title="Second Page Name">
<ion-content>
<ti-segmented-control on-select="buttonClicked($index)" style="width: 100%; padding: 10px; ">
<ti-segmented-control-button class="button-assertive" title="'Yo'" selected></ti-segmented-control-button>
<ti-segmented-control-button class="button-assertive" title="'Ya'" ></ti-segmented-control-button>
</ti-segmented-control>
<ion-list ng-if="selectedIndex === 0">
<ion-item class="item" href="#" collection-repeat="product in theProductQuery track by $index" ng-click='go(product)' >
<h2>{{product.productName | capitalize}}</h2>
</ion-item>
</ion-list>
<ion-infinite-scroll on-infinite="loadMore1()" distance="1%" ng-if="theProductQuery.length"></ion-infinite-scroll>
Here’s my loadMore1()
function :
$scope.loadMore1 = function() {
alert('test'); // does not show
var lenAll = Object.keys(jsonObj).length;
var lenActual = $scope.theProductQuery.length;
if ( lenAll == lenActual ) {
$scope.canLoadProd = false;
} else {
var valueIndex = parseInt(localStorage.getItem("indexArrayProds")) + +1;
localStorage.setItem("indexArrayProds", valueIndex);
$scope.loadMoreProds();
}
$scope.$broadcast('scroll.infiniteScrollComplete');
};
Thanks !