Home AngularJS - Unknown Provider when using infinite scroll
Reply: 0

AngularJS - Unknown Provider when using infinite scroll

user1675 Published in April 22, 2018, 10:09 pm

I am trying to use angularJS infinite scroll in my app. According to the documentation i created a service for it in a different file like so

.factory('iScroll', function($http) {
    var iScroll = function(pre_url){
        this.items = [];
        this.busy = false;
        this.page = 1;
        this.pre_url = pre_url;
    iScroll.prototype.nextPage = function(){
        if(this.busy) return;
        this.busy = true;
        var url = this.pre_url + 'page='+this.page;
            for (var i = 0; i < response.data.length; i++){
            this.busy = false;
    return iScroll;

My controller looks like

angular.module('app', ['datatables', 'datatables.select', 'infinite-scroll'])
.controller('ReportsUsersCtrl',  ['DTOptionsBuilder', 'DTColumnDefBuilder', '$scope', '$stateParams', '$http', '$uibModal', '$log', '$timeout', 'SweetAlert', 'iScroll', ReportsUsersCtrl]);

function ReportsUsersCtrl(DTOptionsBuilder, DTColumnDefBuilder, $scope, $stateParams, $http, $uibModal, $log, $timeout, SweetAlert, iScroll) {var 

ctrl = this;
ctrl.id = $stateParams.id;

$scope.load_users = new iScroll('/api/web/branches/users/' +$stateParams.id+'?');


The error i get is: Error: [$injector:unpr] Unknown provider: iScrollProvider <- iScroll <- ReportsUsersCtrl

Can someone please point out what i am doing wrong?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312037 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO