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
618 B

7 years ago
7 years ago
7 years ago
  1. angular.module('app.offerCar', ['pascalprecht.translate'])
  2. .controller('OfferCarCtrl', function($scope, $stateParams, $translate,
  3. $http, $filter) {
  4. $scope.newtravel={};
  5. $scope.createTravel =function(){
  6. $scope.newtravel.type="offering";
  7. $http({
  8. url: urlapi + 'travels',
  9. method: "POST",
  10. data: $scope.newtravel
  11. })
  12. .then(function(data) {
  13. console.log(data);
  14. window.location="#app/travels"
  15. },
  16. function(data) { // optional
  17. // failed
  18. console.log(data);
  19. });
  20. };
  21. });