Commit 9e0d276b06a7be0267b73b454463b29c3ddcb35c

Authored by Eric Fernandez
Exists in master and in 2 other branches demo, develop

Merge branch 'master' into 'master'

Master (pmarco)

See merge request modulos-npm/foca-botonera-principal!7
src/etc/develop.js.ejemplo
1 1 angular.module('focaBotoneraPrincipal')
2 2 .constant("API_ENDPOINT", {
3 3 'URL': '//127.0.0.1:9000'
4   - });
  4 + })
  5 + .constant("APP", ''); // Posibles valores '', 'distribuidor', 'transportista'
src/js/controller.js
1 1 angular.module('focaBotoneraPrincipal')
2 2 .controller('focaBotoneraPrincipalController', [
3   - '$scope', '$location', '$cookies', 'botones', 'focaModalService',
4   - function($scope, $location, $cookies, botones, focaModalService) {
  3 + '$scope', '$location', '$cookies', 'botones', 'focaModalService', 'APP',
  4 + function($scope, $location, $cookies, botones, focaModalService, APP) {
5 5 $scope.paginas = [];
6   - $scope.paginas.push(botones.data);
  6 + if(APP !== '') {
  7 + $scope.paginas.push(botones.data.slice(0, 3));
  8 + $scope.paginas.push(botones.data.slice(3, 6));
  9 + } else {
  10 + $scope.paginas.push(botones.data);
  11 + }
7 12  
8 13 $scope.irA = function(accion) {
9 14 $location.path(accion);
... ... @@ -4,9 +4,12 @@ angular.module('focaBotoneraPrincipal')
4 4 controller: 'focaBotoneraPrincipalController',
5 5 templateUrl: 'src/views/foca-botonera-principal.html',
6 6 resolve: {
7   - botones: ['focaBotoneraPrincipalService', function(focaBotoneraPrincipalService) {
8   - return focaBotoneraPrincipalService.obtenerBotones();
9   - }]
  7 + botones: [
  8 + 'focaBotoneraPrincipalService', 'APP',
  9 + function(focaBotoneraPrincipalService, APP) {
  10 + return focaBotoneraPrincipalService.obtenerBotones(APP);
  11 + }
  12 + ]
10 13 }
11 14 });
12 15 }]);
... ... @@ -3,8 +3,8 @@ angular.module('focaBotoneraPrincipal')
3 3 '$http', 'API_ENDPOINT',
4 4 function($http, API_ENDPOINT) {
5 5 return {
6   - obtenerBotones: function() {
7   - return $http.get(API_ENDPOINT.URL + '/boton');
  6 + obtenerBotones: function(app) {
  7 + return $http.get(API_ENDPOINT.URL + '/boton' + '/' + app);
8 8 }
9 9 };
10 10 }