SHARE
TWEET

Untitled

a guest Dec 22nd, 2014 155 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. booka.controller('createBookingController', ['$rootScope', '$scope', '$stateParams', '$modalInstance', 'Restangular', function($scope, $rootScope, $stateParams, $modalInstance, Restangular) {
  2.  
  3.     $scope.booking = {
  4.         booking_date: $stateParams.booking_date,
  5.         booking_time: $stateParams.booking_time
  6.     };
  7.  
  8.     $scope.dismiss = function() {
  9.         $modalInstance.dismiss();
  10.     };
  11.  
  12.     $scope.save = function() {
  13.         console.log('BOOKING CREATED BITCH');
  14.        
  15.         console.log($rootScope);
  16.         Restangular.all('bookings').post($scope.booking).then(function(booking) {
  17.             console.log($rootScope);
  18.             $rootScope.$emit('bookings-updated');
  19.         });
  20.         $modalInstance.close('results');
  21.     };
  22.  
  23. }]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top