controller.js
1020 Bytes
angular.module('focaBotoneraPrincipal')
.controller('focaBotoneraPrincipalController', [
'$scope', '$location', '$cookies', 'botones', 'focaModalService', 'APP',
function($scope, $location, $cookies, botones, focaModalService, APP) {
$scope.paginas = [];
var botonesPorPagina = 12;
if(APP === 'distribuidor' || APP === 'transportista') {
botonesPorPagina = 3;
}
for(var i = 0; i < botones.data.length; i += botonesPorPagina){
$scope.paginas.push(botones.data.slice(i, i + botonesPorPagina));
}
$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);
};
}
]);