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.

24 lines
697 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.travels = [];
  11. $scope.pageTravels = 0;
  12. $http.get(urlapi + 'travels?page=' + $scope.pageTravels)
  13. .then(function(data) {
  14. console.log('data success');
  15. console.log(data);
  16. $scope.travels = data.data;
  17. }, function(data) {
  18. console.log('data error');
  19. });
  20. });