Skip to content

Commit

Permalink
trying out audio_recordings/filter
Browse files Browse the repository at this point in the history
  • Loading branch information
cofiem authored and atruskie committed Oct 31, 2014
1 parent ba8cd96 commit 3b793cf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<li>{{dataPoint}}</li>
</ol>

<div id="audioRecordingCalendar"></div>
<div id="audioRecordingCalendar"></div>

{{filteredAudioRecordings}}
38 changes: 33 additions & 5 deletions src/app/d3Bindings/d3TestPage.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
var bawD3 = bawD3 || angular.module("bawApp.d3", []);
bawD3.controller('D3TestPageCtrl', ['$scope', function($scope) {
bawD3.controller('D3TestPageCtrl', ['$scope', 'conf.paths', '$http', function ($scope, paths, $http) {

// use the REST API in here
// assign the resulting data to scope (not great but it will do for now
$scope.basicData = [0,1,2,3,4,5];
// use the REST API in here
// assign the resulting data to scope (not great but it will do for now
$scope.basicData = [0, 1, 2, 3, 4, 5];

}]);
$scope.siteId = 399;

var request_filter = {
"filter": {
"site_id":{
"eq":$scope.siteId
}
},
"projection": {
"include": ["id", "recorded_date", "duration_seconds"]
}//,
//"paging":{
// "page":2,
// "items":30
//}
};

$http.post(paths.api.routes.audioRecording.filterAbsolute, request_filter)
.success(function (data, status, headers, config) {

$scope.filteredAudioRecordings = data;
})
.error(function (data, status, headers, config) {
$scope.filteredAudioRecordings = data;
console.warn('Filtered audio recordings failed.', data, status, headers, config);
});


}]);

0 comments on commit 3b793cf

Please sign in to comment.