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.

49 lines
1.4 KiB

  1. 'use strict';
  2. angular.module('app.main', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/main', {
  5. templateUrl: 'views/main/main.html',
  6. controller: 'MainCtrl'
  7. });
  8. }])
  9. .controller('MainCtrl', function($scope, $http) {
  10. $scope.users = [];
  11. $scope.loadMorePagination = true;
  12. $scope.pageUsers = 0;
  13. $http.get(urlapi + 'users?page=' + $scope.pageUsers)
  14. .then(function(data) {
  15. console.log('data success');
  16. console.log(data);
  17. $scope.users = data.data;
  18. }, function(data) {
  19. console.log('data error');
  20. });
  21. $scope.travels = [];
  22. $scope.pageTravels = 0;
  23. $http.get(urlapi + 'travels?page=' + $scope.pageTravels)
  24. .then(function(data) {
  25. console.log('data success');
  26. console.log(data);
  27. $scope.travels = data.data;
  28. }, function(data) {
  29. console.log('data error');
  30. });
  31. $scope.admins=[];
  32. $scope.pageAdmins = 0;
  33. $http.get(urlapi + 'admins?page=' + $scope.pageAdmins)
  34. .then(function(data) {
  35. console.log('data success');
  36. console.log(data);
  37. $scope.admins = data.data;
  38. }, function(data) {
  39. console.log('data error');
  40. });
  41. });