modules/select/demo/js/demo-select_controller.js
function callApi() {
            vm.pageInfiniteScroll++;
            vm.loadingInfiniteScroll = true;

            return $http
                .get(
                    'https://randomuser.me/api/?results=10&seed=lumapps&page=' + vm.pageInfiniteScroll
                )
                .then(function(response) {
                    if (response.data && response.data.results) {
                        return response.data.results.map(function(person) {
                            return {
                                name: person.name.first,
                                email: person.email,
                                age: person.dob.age
                            };
                        });
                    } else {
                        return [];
                    }
                })
                .catch(function() {
                    return [];
                })
                .finally(function() {
                    vm.loadingInfiniteScroll = false;
                });
        }
function callApi() {
            vm.pageInfiniteScroll++;
            vm.loadingInfiniteScroll = true;

            return $http
                .get(
                    'https://randomuser.me/api/?results=10&seed=lumapps&page=' + vm.pageInfiniteScroll
                )
                .then(function(response) {
                    if (response.data && response.data.results) {
                        return response.data.results.map(function(person) {
                            return {
                                name: person.name.first,
                                email: person.email,
                                age: person.dob.age
                            };
                        });
                    } else {
                        return [];
                    }
                })
                .catch(function() {
                    return [];
                })
                .finally(function() {
                    vm.loadingInfiniteScroll = false;
                });
        }
function callApi ( ) { vm . pageInfiniteScroll ++ ; vm . loadingInfiniteScroll = true ; return $http . get ( 'https://randomuser.me/api/?results=10&seed=lumapps&page=' + vm . pageInfiniteScroll ) . then ( function ( response ) { if ( response . data && response . data . results ) { return response . data . results . map ( function ( person ) { return { name : person . name . first , email : person . email , age : person . dob . age } ; } ) ; } else { return [ ] ; } } ) . catch ( function ( ) { return [ ] ; } ) . finally ( function ( ) { vm . loadingInfiniteScroll = false ; } ) ; }
Call sample API.

@return {Promise} Promise containing an array of users.
Call sample API .