samedi 9 mai 2015

QuantumUI Pagination

I'm new to Angularjs and trying to do pagination in Quantumui for which i get data from RestAngular, i can able to create pagination using ng-Table successfully for the same connects but i'm but cant able to do the same with Quantumui's '$pageableProvider' i tried it as below help me to understand the concept of Quantumui.

I Get the Following Error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module restAngular due to:
Error: [$injector:modulerr] Failed to instantiate module nqPageable due to:
Error: [$injector:nomod] Module 'nqPageable' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument

My App.js:

i use RestAngular to get data

var get = angular.module('get', []);

var myApp =angular.module('restAngular',[
    'restangular',
    'get',
    'create',
    'ngSanitize',
    'ngAnimate',
    'ngQuantum',
    'nqPageable',
    'ngTable'
])
myApp.config([
    'RestangularProvider',
    '$pageableProvider',
    function(RestangularProvider,$pageableProvider){
        RestangularProvider.setBaseUrl('http://localhost:1337/lb4b/api/');
        var mydefaults = {
            seletable : true,
            pageNumber : 1,
            pageSize : 5
        }
        angular.extend($pageableProvider.defaults, mydefaults)
    }
])

get.controller('getCtrl',[
    'Restangular',
    '$scope',
    'ngTableParams',
    '$filter',
    function(Restangular,$scope,ngTableParams,$filter){

        var userData = Restangular.all('User').getList().then(
            function(user){
                $scope.users = user;
                //This is to check the data has passed succes
                console.log(user[0].business_category);
                //console.log(user.length);            
                //console.log('x  is :'+x );
            }
        )
    }
]);

Can Some one help me to understand the concept of pagination used in quantumui.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire