You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/02/28 06:49:28 UTC
svn commit: r1572833 -
/incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js
Author: joyce
Date: Fri Feb 28 05:49:27 2014
New Revision: 1572833
URL: http://svn.apache.org/r1572833
Log:
CLIMATE-333 - Update ResultDetailCtrl endpoints and result handling
Modified:
incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js
Modified: incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js?rev=1572833&r1=1572832&r2=1572833&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js (original)
+++ incubator/climate/trunk/ocw-ui/frontend/app/js/controllers/ResultDetailCtrl.js Fri Feb 28 05:49:27 2014
@@ -20,19 +20,19 @@
// Controller for result page
App.Controllers.controller('ResultDetailCtrl', ['$rootScope', '$scope', '$http', '$stateParams',
function($rootScope, $scope, $http, $stateParams) {
-
- // Grab all figures
$scope.result = $stateParams.resultId;
- $http.jsonp($rootScope.baseURL + '/getResults//' + $scope.result + '?callback=JSON_CALLBACK')
+ $http.jsonp($rootScope.baseURL + '/dir/results/' + $scope.result + '?callback=JSON_CALLBACK')
.success(function(data) {
- if (data.length < 1){
- $scope.figures = null;
- $scope.alertMessage = "No results found.";
- $scope.alertClass = "alert alert-danger";
- } else {
- $scope.figures = data;
- }
+ data = data['listing'];
+
+ if (data.length < 1) {
+ $scope.figures = null;
+ $scope.alertMessage = "No results found.";
+ $scope.alertClass = "alert alert-danger";
+ } else {
+ $scope.figures = data;
+ }
});
}]);