angular .module('kalgudiApp') .controller('reportActivityFullviewController', ['$scope', '$state', '$rootScope', 'pageServices', 'kalgudiLiterals', function($scope, $state, $rootScope, pageServices, kalgudiLiterals) { $scope.reportActivityId = ''; /** * Initializer */ $scope.init = function () { $scope.reportActivityId = $state.params.reportActivityId; $scope.getActivity(); }; /** * Fetch activity details from service. */ $scope.getActivity = function () { $rootScope.spinerisActive = true; pageServices.getReportActivityDetails($scope.reportActivityId).then( function (res) { $rootScope.spinerisActive = false; if (res) { $scope.activity = res.reportActivity; } console.log($scope.activity); }, function (err) { $rootScope.spinerisActive = false; console.log('Unable to get report activity details.', err); } ); } /* ---------------- NOTHING BEYOND --------------- */ $scope.init(); }]);