app.controller("alertasCompromissosController", function ($scope, $modal, $upload, $rootScope, dataService, httpRequestFactory, notificationFactory, $location) {
    
   
    $scope.selRow = function (row) {

        if (row == null)
            return;
               
        $scope.selectedRow = row;
    };
        

    $scope.carregarAlertas = function () {
        var getSuccessCallback = function (data, status) {
            $scope.lstItems = data;
        };

        var errorCallback = function (data, status, headers, config) {
            
        };


        httpRequestFactory.getData('../api/alertas/compromissos').success(getSuccessCallback).error(errorCallback);
        
    };
    

    $scope.mostrarAlertas = function () {
        var row = { lst: $scope.lstItems }

        var modalInstance = $modal.open(
        {

            templateUrl: 'views/modalAlertasCompromissos.html',
            controller: 'modalController',
            backdrop: 'static',
            keyboard: false,
            resolve: {
                items: function () { return row; }
            }

        });

        modalInstance.result.then(function (item) {
            
        }, function () {

        });
    };
   
});