You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
902 B

  1. angular.module('app.users', ['pascalprecht.translate'])
  2. .controller('UsersCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) {
  3. $scope.users=[];
  4. $scope.page=0;
  5. $scope.doRefresh = function() {
  6. /* users refresh: */
  7. $http.get(urlapi + 'users?page=' + $scope.page)
  8. .then(function(data){
  9. console.log('data success users');
  10. console.log(data); // for browser console
  11. //$scope.users = data.data; // for UI
  12. $scope.users=data.data;
  13. $scope.$broadcast('scroll.refreshComplete');//refresher stop
  14. }, function(data){
  15. console.log('data error');
  16. $scope.$broadcast('scroll.refreshComplete');//refresher stop
  17. $ionicLoading.show({ template: 'Error connecting server', noBackdrop: true, duration: 2000 });
  18. });
  19. };
  20. $scope.doRefresh();
  21. });