Parent: [0765ef] (diff)

Child: [bd5300] (diff)

Download this file

viewCtrl.js    28 lines (26 with data), 916 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
/*made by Miguel Rodrigues @ KBZ miguel.rodrigues@knowledgebiz.pt*/
console.log("Defining viewCtrl");
angular.module('mainApp')
.controller('viewCtrl', function($scope, $routeParams, $http, appService) {
$scope.appId = $routeParams.appid;
$scope.developerid = $routeParams.developerid;
$scope.data = false;
appService.getAppNotifications($routeParams.appid).then(function(response){
if(response.data.success){
if(response.data.data.length > 0){
console.log("getAppNotifications response: " + JSON.stringify(response.data));
$scope.notifications = response.data.data;
}else{
$scope.data = true;
$scope.noData = "There is no recorded Data";
}
}
},function(err){
console.log("Resource doesn't exist");
$scope.error = err.data.data;
});
$scope.redirectAppManager = function () {
window.location = '/'+$routeParams.developerid
};
console.log("Loading viewCtrl");
});