diff --git a/.gitignore b/.gitignore index 4a625cf23..2e44064a0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules bower_components .idea *.apk +npm-debug.log +npm-debug.log.* diff --git a/www/js/controllers/search-controller.js b/www/js/controllers/search-controller.js index 3c404c66d..39bfec0d6 100644 --- a/www/js/controllers/search-controller.js +++ b/www/js/controllers/search-controller.js @@ -1,4 +1,4 @@ -angular.module('pvta.controllers').controller('SearchController', function($scope, $ionicFilterBar, $resource, RouteList, StopList, Stops){ +angular.module('pvta.controllers').controller('SearchController', function($scope, $ionicFilterBar, $resource, RouteList, StopList, Stops, Avail){ var filterBarInstance; function getItems () { $scope.all = []; @@ -24,7 +24,7 @@ angular.module('pvta.controllers').controller('SearchController', function($scop return routes; } if(RouteList.isEmpty()){ - var routes = $resource('http://bustracker.pvta.com/infopoint/rest/routes/getallroutes').query({}, function(){ + var routes = $resource(Avail + '/routes/getallroutes').query({}, function(){ routes = prepareRoutes(routes); RouteList.pushEntireList(routes); }); diff --git a/www/js/services.js b/www/js/services.js index 9fdce72ae..07ae3fddf 100644 --- a/www/js/services.js +++ b/www/js/services.js @@ -1,38 +1,42 @@ angular.module('pvta.services', ['ngResource']) -.factory('Vehicle', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/vehicles/get/:vehicleId'); +.factory('Avail', function(){ + return 'http://bustracker.pvta.com/infopoint/rest'; }) -.factory('Route', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/routedetails/get/:routeId'); +.factory('Vehicle', function ($resource, Avail) { + return $resource(Avail + '/vehicles/get/:vehicleId'); }) -.factory('Routes', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/routes/getvisibleroutes'); +.factory('Route', function ($resource, Avail) { + return $resource(Avail + '/routedetails/get/:routeId'); }) -.factory('Stop', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/stops/get/:stopId'); +.factory('Routes', function ($resource, Avail) { + return $resource(Avail + '/routes/getvisibleroutes'); }) -.factory('Stops', function($resource){ - return $resource('http://bustracker.pvta.com/infopoint/rest/stops/getallstops'); +.factory('Stop', function ($resource, Avail) { + return $resource(Avail + '/stops/get/:stopId'); }) -.factory('RouteVehicles', function($resource){ - return $resource('http://bustracker.pvta.com/infopoint/rest/vehicles/getallvehiclesforroute?routeId=:routeId') +.factory('Stops', function ($resource, Avail){ + return $resource(Avail + '/stops/getallstops'); }) -.factory('StopDeparture', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/stopdepartures/get/:stopId'); +.factory('RouteVehicles', function ($resource, Avail){ + return $resource(Avail + '/vehicles/getallvehiclesforroute?routeId=:routeId') }) -.factory('Messages', function ($resource) { - return $resource('http://bustracker.pvta.com/infopoint/rest/publicmessages/getcurrentmessages'); +.factory('StopDeparture', function ($resource, Avail) { + return $resource(Avail + '/stopdepartures/get/:stopId'); }) -.factory('SimpleRoute', function($resource){ - return $resource('http://bustracker.pvta.com/infopoint/rest/routes/get/:routeId'); + +.factory('Messages', function ($resource, Avail) { + return $resource(Avail + '/publicmessages/getcurrentmessages'); +}) +.factory('SimpleRoute', function ($resource, Avail){ + return $resource(Avail + '/routes/get/:routeId'); })