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.

23 lines
648 B

  1. 'use strict';
  2. angular.module('app.travel', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/travel/:travelid', {
  5. templateUrl: 'views/travel/travel.html',
  6. controller: 'TravelCtrl'
  7. });
  8. }])
  9. .controller('TravelCtrl', function($scope, $http, $routeParams) {
  10. $scope.travel = {};
  11. $http.get(urlapi + 'travels/id/' + $routeParams.travelid)
  12. .then(function(data, status, headers, config) {
  13. console.log('data success');
  14. console.log(data);
  15. $scope.travel = data.data;
  16. }, function(data, status, headers, config) {
  17. console.log('data error');
  18. });
  19. });