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.

35 lines
877 B

  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.page = 0;
  13. $http.get(urlapi + 'users?page=' + $scope.page)
  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. $http.get(urlapi + 'travels?page=' + $scope.page)
  22. .then(function(data) {
  23. console.log('data success');
  24. console.log(data);
  25. $scope.travels=data.data;
  26. }, function(data) {
  27. console.log('data error');
  28. });
  29. });