|
1 | 1 |
|
2 | | -var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory) { |
| 2 | +var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory, productConfig) { |
3 | 3 | $scope.a = 5; |
4 | 4 | $scope.b = 6; //reportConfigController |
5 | 5 |
|
@@ -122,18 +122,20 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory) |
122 | 122 | $scope.progressMessage = 'Getting data... (can take a few minutes)' |
123 | 123 | $scope.progressbarState = 100; |
124 | 124 | // TODO: modify this query to run a separate query per product |
125 | | - $scope.reportData = runReportFactory.query( |
126 | | - {'startDate': utcStart, |
127 | | - 'endDate': utcEnd, |
128 | | - 'reportResolution': reportResolution}, function() { |
129 | | - var i, j, row, chartData; |
130 | | - chartData = restructData($scope.reportData); |
131 | | - $scope.chartObject = chartData; |
132 | | - console.log('chartObject'); |
133 | | - console.log(JSON.stringify(chartData)); |
134 | | - $scope.showprogress = false; |
135 | | - }); |
136 | | - |
| 125 | + //$scope.products = productConfig.query({}, function() { |
| 126 | + //console.log("products:" + $scope.products ); |
| 127 | + $scope.reportData = runReportFactory.query( |
| 128 | + {'startDate': utcStart, |
| 129 | + 'endDate': utcEnd, |
| 130 | + 'reportResolution': reportResolution}, function() { |
| 131 | + var i, j, row, chartData; |
| 132 | + chartData = restructData($scope.reportData); |
| 133 | + $scope.chartObject = chartData; |
| 134 | + console.log('chartObject'); |
| 135 | + console.log(JSON.stringify(chartData)); |
| 136 | + $scope.showprogress = false; |
| 137 | + }); |
| 138 | + //) |
137 | 139 | }; |
138 | 140 |
|
139 | 141 | function restructData(inData) { |
@@ -211,7 +213,7 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory) |
211 | 213 | }; |
212 | 214 | retData.formatters = {}; |
213 | 215 | return retData; |
214 | | - } |
| 216 | + }; |
215 | 217 |
|
216 | 218 | function showChart() { |
217 | 219 | $scope.chart = ''; |
@@ -240,4 +242,4 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory) |
240 | 242 |
|
241 | 243 | }; |
242 | 244 |
|
243 | | -ESRIStatsApp.controller('reportConfigController', ['$scope', '$routeParams', '$location', 'runReportFactory', cntrlFunction]); |
| 245 | +ESRIStatsApp.controller('reportConfigController', ['$scope', '$routeParams', '$location', 'runReportFactory', 'productConfig', cntrlFunction]); |
0 commit comments