-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_controller.js
More file actions
37 lines (33 loc) · 951 Bytes
/
data_controller.js
File metadata and controls
37 lines (33 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
angular.module("tnTour").controller("DataController", function($resource, $scope, $q){
parseResults = function(data, headersGetter){
var data = angular.fromJson(data);
return data.results
}
Country = $resource(
'https://api.parse.com/1/classes/Country/:objectId',
{objectId: '@objectId'},
{
query: {isArray: true, transformResponse: parseResults},
update: {method: 'PUT'}
}
)
$scope.countries = Country.query();
Tour = $resource(
'https://api.parse.com/1/classes/Tour/:objectId',
{objectId: '@objectId'},
{
query: {isArray: true, transformResponse: parseResults},
update: {method: 'PUT'}
}
)
$scope.tours = Tour.query();
Place = $resource(
'https://api.parse.com/1/classes/Place/:objectId',
{objectId: '@objectId'},
{
query: {isArray: true, transformResponse: parseResults},
update: {method: 'PUT'}
}
)
$scope.places = Place.query();
});