Commit e62f3d0af261fa3bb7a0c78d255d9260b9d33452
1 parent
a45c1c5c86
Exists in
master
and in
1 other branch
lineas en blanco al final
Showing
4 changed files
with
6 additions
and
4 deletions
Show diff stats
index.html
1 | <html ng-app="focaModalEmpresa"> | 1 | <html ng-app="focaModalEmpresa"> |
2 | <head> | 2 | <head> |
3 | <meta charset="UTF-8"> | 3 | <meta charset="UTF-8"> |
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
5 | 5 | ||
6 | <!--CSS--> | 6 | <!--CSS--> |
7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> |
8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> |
9 | 9 | ||
10 | <!--VENDOR JS--> | 10 | <!--VENDOR JS--> |
11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
13 | <script src="node_modules/angular/angular.min.js"></script> | 13 | <script src="node_modules/angular/angular.min.js"></script> |
14 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 14 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
15 | 15 | ||
16 | <!-- BUILD --> | 16 | <!-- BUILD --> |
17 | <script src="src/js/app.js"></script> | 17 | <script src="src/js/app.js"></script> |
18 | <script src="src/js/controller.js"></script> | 18 | <script src="src/js/controller.js"></script> |
19 | <!-- /BUILD --> | 19 | <!-- /BUILD --> |
20 | 20 | ||
21 | </head> | 21 | </head> |
22 | <body> | 22 | <body> |
23 | <foca-nombre-empresa> | 23 | <foca-nombre-empresa> |
24 | </body> | 24 | </body> |
25 | </html> | ||
25 | </html> |
src/js/controller.js
1 | angular.module('focaNombreEmpresa') | 1 | angular.module('focaNombreEmpresa') |
2 | .controller('focaNombreEmpresaController', [ | 2 | .controller('focaNombreEmpresaController', [ |
3 | '$scope', | 3 | '$scope', |
4 | 'focaNombreEmpresaService', | 4 | 'focaNombreEmpresaService', |
5 | function($scope, focaNombreEmpresaService) { | 5 | function($scope, focaNombreEmpresaService) { |
6 | $scope.nombre = ''; | 6 | $scope.nombre = ''; |
7 | $scope.direccion = ''; | 7 | $scope.direccion = ''; |
8 | 8 | ||
9 | var init = function() { | 9 | var init = function() { |
10 | //ID EMPRESA HARDCODEADO | 10 | //ID EMPRESA HARDCODEADO |
11 | focaNombreEmpresaService.getEmpresa(1).then(function(res) { | 11 | focaNombreEmpresaService.getEmpresa(1).then(function(res) { |
12 | $scope.nombre = res.data.NOM; | 12 | $scope.nombre = res.data.NOM; |
13 | $scope.direccion = res.data.DIR; | 13 | $scope.direccion = res.data.DIR; |
14 | }); | 14 | }); |
15 | }; | 15 | }; |
16 | 16 | ||
17 | init(); | 17 | init(); |
18 | }]); | ||
18 | }]); |
src/js/service.js
1 | angular.module('focaNombreEmpresa') | 1 | angular.module('focaNombreEmpresa') |
2 | .service('focaNombreEmpresaService', [ | 2 | .service('focaNombreEmpresaService', [ |
3 | '$http', | 3 | '$http', |
4 | 'API_ENDPOINT', | 4 | 'API_ENDPOINT', |
5 | function($http, API_ENDPOINT) { | 5 | function($http, API_ENDPOINT) { |
6 | return { | 6 | return { |
7 | getEmpresa: function(id) { | 7 | getEmpresa: function(id) { |
8 | return $http.get(API_ENDPOINT.URL + '/empresa/' + id); | 8 | return $http.get(API_ENDPOINT.URL + '/empresa/' + id); |
9 | } | 9 | } |
10 | }; | 10 | }; |
11 | } | 11 | } |
12 | ]); | ||
12 | ]); |
src/views/nombre-empresa.html
1 | <div class="container"> | 1 | <div class="container"> |
2 | <div class="row"> | 2 | <div class="row"> |
3 | <div class="col-md-6"> | 3 | <div class="col-md-6"> |
4 | <h5 class="text-left">{{nombre}}</h5> | 4 | <h5 class="text-left">{{nombre}}</h5> |
5 | </div> | 5 | </div> |
6 | <div class="col-md-6"> | 6 | <div class="col-md-6"> |
7 | <h5 class="text-right">{{direccion}}</h5> | 7 | <h5 class="text-right">{{direccion}}</h5> |
8 | </div> | 8 | </div> |
9 | </div> | 9 | </div> |
10 | </div> | ||
10 | </div> |