post new offering travel, and user page

This commit is contained in:
arnaucode
2017-01-26 14:13:32 +01:00
parent 5f16f060c1
commit 17f0f740d8
15 changed files with 177 additions and 104 deletions

View File

@@ -1,5 +1,23 @@
angular.module('app.offerCar', ['pascalprecht.translate'])
.controller('OfferCarCtrl', function($scope, $stateParams, $translate, $filter) {
.controller('OfferCarCtrl', function($scope, $stateParams, $translate,
$http, $filter) {
$scope.newtravel={};
$scope.createTravel =function(){
$scope.newtravel.type="offering";
$http({
url: urlapi + 'travels',
method: "POST",
data: $scope.newtravel
})
.then(function(data) {
console.log(data);
window.location="#app/travels"
},
function(data) { // optional
// failed
console.log(data);
});
};
});