lib/nestene/ui/public/app/application.js in nestene-0.1.2 vs lib/nestene/ui/public/app/application.js in nestene-0.1.3

- old
+ new

@@ -1,17 +1,15 @@ -var nestene = angular.module('nestene', ['JSONedit']).config(function($locationProvider) { - $locationProvider.html5Mode({ - enabled: true, - requireBase: false - }); -}); +var window_location = window.location.pathname -nestene.controller('AutonsController', function($scope, $http, $timeout, $location) { + +var nestene = angular.module('nestene', ['JSONedit']); + +nestene.controller('AutonsController', function($scope, $http, $timeout) { $scope.autons=[]; $scope.getAutons = function() { - var autonsPromise = $http.get($location.path() + "autons.json"); + var autonsPromise = $http.get(window_location + "autons.json"); autonsPromise.success(function(data, status, headers, config) { $scope.autons = data; }); autonsPromise.error(function(data, status, headers, config) { @@ -28,30 +26,30 @@ $scope.intervalFunction(); }); -nestene.controller('CreateAutonFormController', function($scope,$http, $location) { +nestene.controller('CreateAutonFormController', function($scope,$http) { $scope.autonType = ''; $scope.createAuton = function() { - var postPromise = $http.post($location.path() + "autons",{auton_type: $scope.autonType}); + var postPromise = $http.post(window_location + "autons",{auton_type: $scope.autonType}); postPromise.success(function(data, status, headers, config) { $.bootstrapGrowl("Created "+data['auton_id'], { type: 'success' }); }); postPromise.error(function(data, status, headers, config) { $.bootstrapGrowl("Could not create Auton: "+data['message'], { type: 'error' }); }); }; }); -nestene.controller('CredentialsController', function($scope,$http, $location) { +nestene.controller('CredentialsController', function($scope,$http) { $scope.credentials={}; $scope.loaded = false; $scope.loadCredentials = function() { - var getPromise = $http.get($location.path() + "credentials"); + var getPromise = $http.get(window_location + "credentials"); getPromise.success(function(data, status, headers, config) { $scope.credentials = data; $scope.loaded = true; }); @@ -61,10 +59,10 @@ } $scope.loadCredentials(); $scope.storeCredentials = function() { - var postPromise = $http.post($location.path() + "credentials",$scope.credentials); + var postPromise = $http.post(window_location + "credentials",$scope.credentials); postPromise.success(function(data, status, headers, config) { $.bootstrapGrowl("Credentials saved", { type: 'success' }); }); postPromise.error(function(data, status, headers, config) { $.bootstrapGrowl("Could not save credentials", { type: 'danger' });