(function (app) {
    app
        .controller('ActividadesController', function ($scope, $http, $rootScope, SweetAlert, spsservice, $uibModal, $location, $window, $route) {
      
            $rootScope.menuActivo();
            
            $scope.obtenerReporteAcciones = function(){
                spsservice.get_type('lists/getbytitle', 'Actividades', "/Items?$select=StakeholdersArray,Asunto/Title,ID,Title,Modified,Descripcion,Operacion,Comuna,OtraComuna,Participantes,Gastado,AsuntoId&$top=2000&$orderby=Modified desc&$expand=Asunto").then(function (resp) {
                    $scope.AccionesData = resp.d.results;
                    for (let i = 0; i < $scope.AccionesData.length; i++) {
                        debugger;
                        $scope.AccionesData[i].StakeholdersArray = JSON.parse($scope.AccionesData[i].StakeholdersArray);                       
                    }

                });
            };


            $scope.obtenerReporteAcciones();
        });
}(angular.module('spsmodule')));