sroze / ngInfiniteScroll

Infinite Scrolling for AngularJS
http://sroze.github.com/ngInfiniteScroll/
MIT License
2.89k stars 725 forks source link

ngInfiniteScroll can't be used in ng-view #227

Open yppo opened 8 years ago

yppo commented 8 years ago

I'm using $routeProvider to change between 2 views and it seems that ngInfiniteScrol placed in templateUrl do not get executed.

Is it possible to use it in the html file that will be used as templateUrl ?

hornetnz commented 8 years ago

I just tried to add this to my app and noticed the same thing... In my template: <div class="row searchResultsContainer" ng-hide="oc.orgList.results.length == 0" infinite-scroll="getMyStuff()"> In my controller: `getMyStuff(): void { const that: OrgController = this; this.$rootScope.loading = true;

    that.itemsPromise = this.orgService.loadOrgList(this.$rootScope.search.text, this.$scope.gridOptions.currentPage, this.$scope.gridOptions.pageItems)
        .then((paginatedResults: PaginatedResults<IOrg>) => {
            for (var i = 0; i < paginatedResults.pageSize; i++) {
                that.orgList.results.push(paginatedResults[i].data);
            }
            that.$rootScope.loading = false;
            this.$scope.gridOptions.currentPage++;
        }
        );
}`

When I scroll the page, it doesnt hit my breakpoint at all. :(