Parent: [9b8d78] (diff)

Child: [0765ef] (diff)

Download this file

statisticsCtrl.js    28 lines (24 with data), 1.1 kB

 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
/*made by Miguel Rodrigues @ KBZ miguel.rodrigues@knowledgebiz.pt*/
console.log("Defining statisticsCtrl");
angular.module('mainApp')
.controller('statisticsCtrl', function($scope, $routeParams, $http, appService) {
$scope.appID = $routeParams.appid;
console.log("Running statisticsCtrl for developerid (" + $routeParams.developerid + ")");
appService.getRuleStatistics($routeParams.rulesid).then(function(response){
if(response.data.success){
console.log("getRuleStatistics response: " + JSON.stringify(response.data));
$scope.statistics = response.data.data;
var json = JSON.stringify(response.data);
$scope.totalNotifications = response.data.total.totalNotifications;
$scope.totalNotificationsApplyByRules = response.data.total.totalNotificationsApplyByRules;
$scope.averageValue = response.data.total.averageValue;
$scope.percentage = response.data.total.percentage;
}else{
//call notification service
console.log("Something went wrong...");
}
}).then(function(){
console.log("getRuleStatistics timed out");
});
console.log("Loading statisticsCtrl");
});