Download pool/shard004/JavaScript/0025225_create-trip-controller.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025225_create-trip-controller.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard004/JavaScript/0025225_create-trip-controller.js
-
curl -L -o 0025225_create-trip-controller.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard004/JavaScript/0025225_create-trip-controller.js
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]) | |
| }()) |