controller.js 942 Bytes
angular.module('focaBotoneraPrincipal')
    .controller('focaBotoneraPrincipalController', [
        '$scope', '$location', '$cookies', 'botones', 'focaModalService', 'APP',
        function($scope, $location, $cookies, botones, focaModalService, APP) {
            $scope.paginas = [];
            if(APP === 'distribuidor') {
                $scope.paginas.push(botones.data.slice(0, 3));
                $scope.paginas.push(botones.data.slice(3, 6));
            } else {
                $scope.paginas.push(botones.data);
            }

            $scope.irA = function(accion) {
                $location.path(accion);
            };

            $scope.logout = function() {
                $location.path('/logout');
            };

            $scope.showTerminal = function() {
                var key = $cookies.get('terminalKey');
                focaModalService.alert('SU TERMINAL ES: ' + key);
            };
        }
    ]);