sajaniemi_variable_dataset_large / pool /shard004 /JavaScript /0025225_create-trip-controller.js
Pendigard's picture
Upload folder using huggingface_hub (part 53)
7e79d67 verified
Raw History Blame Contribute Delete
764 Bytes
(function () {
'use strict'
function CreateTripController($location, identity, trips, notifier, cities) {
var vm = this;
if (!identity.isAuthenticated()) {
$location.path('/unauthorized');
}
vm.createTrip = function (trip) {
debugger;
trips.createTrip(trip)
.then(function (res) {
notifier.success('You have succesfully created trip');
$location.path('/trips');
})
}
cities.getAll()
.then(function (res) {
vm.cities = res;
})
}
angular.module('myApp')
.controller('CreateTripController', ['$location', 'identity', 'trips', 'notifier', 'cities', CreateTripController])
}())