Angular - employees does no appear in component











up vote
0
down vote

favorite












I'm trying to show register employees in my angular app, but it doesn't appear the values, only creates their items of the array, i make a console.log to see what's wrong and it looks like to be the variables are undefined. Help please



empleado.component.html



<div class="row animated fadeIn">
<div class="col-12">
<div class="card">
<div class="card-body">
<h3 class="card-title"> Empleados registrados </h3>

<table class="table table-hover" >
<thead>
<tr>
<th>Nombre</th>
<th>Codigo</th>
<th>Posicion</th>
<th>Oficina</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let empleado of empleados">
<td>{{empleado.nombre}}</td>
<td>{{empleado.codigo}}</td>
<td>{{empleado.posicion}}</td>
<td>{{empleado.oficina}}</td>
<td>
<button class="btn btn-primary"> <i class="fa fa-save"></i></button>
<button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</div>


empleado.component.ts



    import { Component, OnInit } from '@angular/core';
import { Empleado } from '../models/empleado.model';
import { EmpleadoService } from '../services/empleado.service';

@Component({
selector: 'app-empleado',
templateUrl: './empleado.component.html',
styleUrls: ['./empleado.component.css']
})
export class EmpleadoComponent implements OnInit {

empleados: any = ;

constructor(public empleadoServ: EmpleadoService) { }

ngOnInit() {
this.traerEmpleados();
console.log(this.empleados.length);
}

traerEmpleados() {
this.empleadoServ.getEmpleados()
.subscribe( (resp: any) => {
console.log(resp[0].nombre);

for (let index = 0; index < resp.length; index++) {
this.empleados[index] = resp[index];
console.log(this.empleados[index]);
}
// JSON.stringify(this.empleados);
console.log(this.empleados[0].nombre);
});

}

}


empleado.service.ts



    import { Injectable } from '@angular/core';
import { Empleado } from '../models/empleado.model';

import { HttpClient } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { map, catchError } from 'rxjs/operators';


import swal from 'sweetalert';

@Injectable({
providedIn: 'root'
})
export class EmpleadoService {

constructor(public http: HttpClient) { }

guardarEmpleado(empleado: Empleado): Observable<any> {
return this.http.post('http://localhost:62200/api/Empleado', empleado)
.pipe(
map( (resp: any) => {
swal('Empleado creado', empleado.nombre, 'success');
return empleado;
}),
catchError((e: any) => throwError(e))
);
}


getEmpleados() {
return this.http.get('http://localhost:62200/api/Empleado');
}

borrarEmpleado(id: number): Observable <any> {
return this.http.delete('http://localhost:62200/api/Empleado/' + id)
.pipe(
map( (resp: any) => {
swal('Empleado eliminado', 'Borrado', 'warning');
return resp;
}),
catchError((e: any) => throwError(e))
);
}

}


And when i try to show employees, it creates the items but it doesn't show the name, code, position, office.



Error










share|improve this question




























    up vote
    0
    down vote

    favorite












    I'm trying to show register employees in my angular app, but it doesn't appear the values, only creates their items of the array, i make a console.log to see what's wrong and it looks like to be the variables are undefined. Help please



    empleado.component.html



    <div class="row animated fadeIn">
    <div class="col-12">
    <div class="card">
    <div class="card-body">
    <h3 class="card-title"> Empleados registrados </h3>

    <table class="table table-hover" >
    <thead>
    <tr>
    <th>Nombre</th>
    <th>Codigo</th>
    <th>Posicion</th>
    <th>Oficina</th>
    <th></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let empleado of empleados">
    <td>{{empleado.nombre}}</td>
    <td>{{empleado.codigo}}</td>
    <td>{{empleado.posicion}}</td>
    <td>{{empleado.oficina}}</td>
    <td>
    <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
    <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
    </td>
    </tr>
    </tbody>
    </table>

    </div>
    </div>
    </div>
    </div>


    empleado.component.ts



        import { Component, OnInit } from '@angular/core';
    import { Empleado } from '../models/empleado.model';
    import { EmpleadoService } from '../services/empleado.service';

    @Component({
    selector: 'app-empleado',
    templateUrl: './empleado.component.html',
    styleUrls: ['./empleado.component.css']
    })
    export class EmpleadoComponent implements OnInit {

    empleados: any = ;

    constructor(public empleadoServ: EmpleadoService) { }

    ngOnInit() {
    this.traerEmpleados();
    console.log(this.empleados.length);
    }

    traerEmpleados() {
    this.empleadoServ.getEmpleados()
    .subscribe( (resp: any) => {
    console.log(resp[0].nombre);

    for (let index = 0; index < resp.length; index++) {
    this.empleados[index] = resp[index];
    console.log(this.empleados[index]);
    }
    // JSON.stringify(this.empleados);
    console.log(this.empleados[0].nombre);
    });

    }

    }


    empleado.service.ts



        import { Injectable } from '@angular/core';
    import { Empleado } from '../models/empleado.model';

    import { HttpClient } from '@angular/common/http';
    import { Observable, throwError } from 'rxjs';
    import { map, catchError } from 'rxjs/operators';


    import swal from 'sweetalert';

    @Injectable({
    providedIn: 'root'
    })
    export class EmpleadoService {

    constructor(public http: HttpClient) { }

    guardarEmpleado(empleado: Empleado): Observable<any> {
    return this.http.post('http://localhost:62200/api/Empleado', empleado)
    .pipe(
    map( (resp: any) => {
    swal('Empleado creado', empleado.nombre, 'success');
    return empleado;
    }),
    catchError((e: any) => throwError(e))
    );
    }


    getEmpleados() {
    return this.http.get('http://localhost:62200/api/Empleado');
    }

    borrarEmpleado(id: number): Observable <any> {
    return this.http.delete('http://localhost:62200/api/Empleado/' + id)
    .pipe(
    map( (resp: any) => {
    swal('Empleado eliminado', 'Borrado', 'warning');
    return resp;
    }),
    catchError((e: any) => throwError(e))
    );
    }

    }


    And when i try to show employees, it creates the items but it doesn't show the name, code, position, office.



    Error










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to show register employees in my angular app, but it doesn't appear the values, only creates their items of the array, i make a console.log to see what's wrong and it looks like to be the variables are undefined. Help please



      empleado.component.html



      <div class="row animated fadeIn">
      <div class="col-12">
      <div class="card">
      <div class="card-body">
      <h3 class="card-title"> Empleados registrados </h3>

      <table class="table table-hover" >
      <thead>
      <tr>
      <th>Nombre</th>
      <th>Codigo</th>
      <th>Posicion</th>
      <th>Oficina</th>
      <th></th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let empleado of empleados">
      <td>{{empleado.nombre}}</td>
      <td>{{empleado.codigo}}</td>
      <td>{{empleado.posicion}}</td>
      <td>{{empleado.oficina}}</td>
      <td>
      <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
      <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
      </td>
      </tr>
      </tbody>
      </table>

      </div>
      </div>
      </div>
      </div>


      empleado.component.ts



          import { Component, OnInit } from '@angular/core';
      import { Empleado } from '../models/empleado.model';
      import { EmpleadoService } from '../services/empleado.service';

      @Component({
      selector: 'app-empleado',
      templateUrl: './empleado.component.html',
      styleUrls: ['./empleado.component.css']
      })
      export class EmpleadoComponent implements OnInit {

      empleados: any = ;

      constructor(public empleadoServ: EmpleadoService) { }

      ngOnInit() {
      this.traerEmpleados();
      console.log(this.empleados.length);
      }

      traerEmpleados() {
      this.empleadoServ.getEmpleados()
      .subscribe( (resp: any) => {
      console.log(resp[0].nombre);

      for (let index = 0; index < resp.length; index++) {
      this.empleados[index] = resp[index];
      console.log(this.empleados[index]);
      }
      // JSON.stringify(this.empleados);
      console.log(this.empleados[0].nombre);
      });

      }

      }


      empleado.service.ts



          import { Injectable } from '@angular/core';
      import { Empleado } from '../models/empleado.model';

      import { HttpClient } from '@angular/common/http';
      import { Observable, throwError } from 'rxjs';
      import { map, catchError } from 'rxjs/operators';


      import swal from 'sweetalert';

      @Injectable({
      providedIn: 'root'
      })
      export class EmpleadoService {

      constructor(public http: HttpClient) { }

      guardarEmpleado(empleado: Empleado): Observable<any> {
      return this.http.post('http://localhost:62200/api/Empleado', empleado)
      .pipe(
      map( (resp: any) => {
      swal('Empleado creado', empleado.nombre, 'success');
      return empleado;
      }),
      catchError((e: any) => throwError(e))
      );
      }


      getEmpleados() {
      return this.http.get('http://localhost:62200/api/Empleado');
      }

      borrarEmpleado(id: number): Observable <any> {
      return this.http.delete('http://localhost:62200/api/Empleado/' + id)
      .pipe(
      map( (resp: any) => {
      swal('Empleado eliminado', 'Borrado', 'warning');
      return resp;
      }),
      catchError((e: any) => throwError(e))
      );
      }

      }


      And when i try to show employees, it creates the items but it doesn't show the name, code, position, office.



      Error










      share|improve this question















      I'm trying to show register employees in my angular app, but it doesn't appear the values, only creates their items of the array, i make a console.log to see what's wrong and it looks like to be the variables are undefined. Help please



      empleado.component.html



      <div class="row animated fadeIn">
      <div class="col-12">
      <div class="card">
      <div class="card-body">
      <h3 class="card-title"> Empleados registrados </h3>

      <table class="table table-hover" >
      <thead>
      <tr>
      <th>Nombre</th>
      <th>Codigo</th>
      <th>Posicion</th>
      <th>Oficina</th>
      <th></th>
      </tr>
      </thead>
      <tbody>
      <tr *ngFor="let empleado of empleados">
      <td>{{empleado.nombre}}</td>
      <td>{{empleado.codigo}}</td>
      <td>{{empleado.posicion}}</td>
      <td>{{empleado.oficina}}</td>
      <td>
      <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
      <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
      </td>
      </tr>
      </tbody>
      </table>

      </div>
      </div>
      </div>
      </div>


      empleado.component.ts



          import { Component, OnInit } from '@angular/core';
      import { Empleado } from '../models/empleado.model';
      import { EmpleadoService } from '../services/empleado.service';

      @Component({
      selector: 'app-empleado',
      templateUrl: './empleado.component.html',
      styleUrls: ['./empleado.component.css']
      })
      export class EmpleadoComponent implements OnInit {

      empleados: any = ;

      constructor(public empleadoServ: EmpleadoService) { }

      ngOnInit() {
      this.traerEmpleados();
      console.log(this.empleados.length);
      }

      traerEmpleados() {
      this.empleadoServ.getEmpleados()
      .subscribe( (resp: any) => {
      console.log(resp[0].nombre);

      for (let index = 0; index < resp.length; index++) {
      this.empleados[index] = resp[index];
      console.log(this.empleados[index]);
      }
      // JSON.stringify(this.empleados);
      console.log(this.empleados[0].nombre);
      });

      }

      }


      empleado.service.ts



          import { Injectable } from '@angular/core';
      import { Empleado } from '../models/empleado.model';

      import { HttpClient } from '@angular/common/http';
      import { Observable, throwError } from 'rxjs';
      import { map, catchError } from 'rxjs/operators';


      import swal from 'sweetalert';

      @Injectable({
      providedIn: 'root'
      })
      export class EmpleadoService {

      constructor(public http: HttpClient) { }

      guardarEmpleado(empleado: Empleado): Observable<any> {
      return this.http.post('http://localhost:62200/api/Empleado', empleado)
      .pipe(
      map( (resp: any) => {
      swal('Empleado creado', empleado.nombre, 'success');
      return empleado;
      }),
      catchError((e: any) => throwError(e))
      );
      }


      getEmpleados() {
      return this.http.get('http://localhost:62200/api/Empleado');
      }

      borrarEmpleado(id: number): Observable <any> {
      return this.http.delete('http://localhost:62200/api/Empleado/' + id)
      .pipe(
      map( (resp: any) => {
      swal('Empleado eliminado', 'Borrado', 'warning');
      return resp;
      }),
      catchError((e: any) => throwError(e))
      );
      }

      }


      And when i try to show employees, it creates the items but it doesn't show the name, code, position, office.



      Error







      angular typescript






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 at 17:46









      Niladri

      3,50321225




      3,50321225










      asked Nov 22 at 17:36









      Leonardo B

      282




      282
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          In your markup, you are using lowercase property names:



                          <td>{{empleado.nombre}}</td>
          <td>{{empleado.codigo}}</td>
          <td>{{empleado.posicion}}</td>
          <td>{{empleado.oficina}}</td>


          Yet in the screenshot, it seems the data objects returned from the server are in uppercase.



          If you change your markup to use the uppercase property names (empleado.Nombre, etc.) I suspect that will do the trick.






          share|improve this answer





















          • Thank you, it works. I cannot believe that was the problem.
            – Leonardo B
            Nov 22 at 18:09


















          up vote
          2
          down vote













          Properties are case sensitive



          For example change empleado.nombre to empleado.Nombre



           <tr *ngFor="let empleado of empleados">
          <td>{{empleado.Nombre}}</td>
          <td>{{empleado.Codigo}}</td>
          <td>{{empleado.Posicion}}</td>
          <td>{{empleado.Oficina}}</td>
          <td>
          <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
          <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
          </td>
          </tr>





          share|improve this answer




























            up vote
            0
            down vote













            why are you displaying alert msg in Service. It should be added in Component.



            did console.log in service returns result? If yes, try with below code.



            Component:



            traerEmpleados() {
            this.empleadoServ.getEmpleados()
            .subscribe( (resp: any) => {
            this.empleados = resp;
            });
            }





            share|improve this answer





















            • It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
              – Leonardo B
              Nov 22 at 17:54











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435953%2fangular-employees-does-no-appear-in-component%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            In your markup, you are using lowercase property names:



                            <td>{{empleado.nombre}}</td>
            <td>{{empleado.codigo}}</td>
            <td>{{empleado.posicion}}</td>
            <td>{{empleado.oficina}}</td>


            Yet in the screenshot, it seems the data objects returned from the server are in uppercase.



            If you change your markup to use the uppercase property names (empleado.Nombre, etc.) I suspect that will do the trick.






            share|improve this answer





















            • Thank you, it works. I cannot believe that was the problem.
              – Leonardo B
              Nov 22 at 18:09















            up vote
            0
            down vote



            accepted










            In your markup, you are using lowercase property names:



                            <td>{{empleado.nombre}}</td>
            <td>{{empleado.codigo}}</td>
            <td>{{empleado.posicion}}</td>
            <td>{{empleado.oficina}}</td>


            Yet in the screenshot, it seems the data objects returned from the server are in uppercase.



            If you change your markup to use the uppercase property names (empleado.Nombre, etc.) I suspect that will do the trick.






            share|improve this answer





















            • Thank you, it works. I cannot believe that was the problem.
              – Leonardo B
              Nov 22 at 18:09













            up vote
            0
            down vote



            accepted







            up vote
            0
            down vote



            accepted






            In your markup, you are using lowercase property names:



                            <td>{{empleado.nombre}}</td>
            <td>{{empleado.codigo}}</td>
            <td>{{empleado.posicion}}</td>
            <td>{{empleado.oficina}}</td>


            Yet in the screenshot, it seems the data objects returned from the server are in uppercase.



            If you change your markup to use the uppercase property names (empleado.Nombre, etc.) I suspect that will do the trick.






            share|improve this answer












            In your markup, you are using lowercase property names:



                            <td>{{empleado.nombre}}</td>
            <td>{{empleado.codigo}}</td>
            <td>{{empleado.posicion}}</td>
            <td>{{empleado.oficina}}</td>


            Yet in the screenshot, it seems the data objects returned from the server are in uppercase.



            If you change your markup to use the uppercase property names (empleado.Nombre, etc.) I suspect that will do the trick.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 22 at 17:48









            Myk Willis

            5,82011936




            5,82011936












            • Thank you, it works. I cannot believe that was the problem.
              – Leonardo B
              Nov 22 at 18:09


















            • Thank you, it works. I cannot believe that was the problem.
              – Leonardo B
              Nov 22 at 18:09
















            Thank you, it works. I cannot believe that was the problem.
            – Leonardo B
            Nov 22 at 18:09




            Thank you, it works. I cannot believe that was the problem.
            – Leonardo B
            Nov 22 at 18:09












            up vote
            2
            down vote













            Properties are case sensitive



            For example change empleado.nombre to empleado.Nombre



             <tr *ngFor="let empleado of empleados">
            <td>{{empleado.Nombre}}</td>
            <td>{{empleado.Codigo}}</td>
            <td>{{empleado.Posicion}}</td>
            <td>{{empleado.Oficina}}</td>
            <td>
            <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
            <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
            </td>
            </tr>





            share|improve this answer

























              up vote
              2
              down vote













              Properties are case sensitive



              For example change empleado.nombre to empleado.Nombre



               <tr *ngFor="let empleado of empleados">
              <td>{{empleado.Nombre}}</td>
              <td>{{empleado.Codigo}}</td>
              <td>{{empleado.Posicion}}</td>
              <td>{{empleado.Oficina}}</td>
              <td>
              <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
              <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
              </td>
              </tr>





              share|improve this answer























                up vote
                2
                down vote










                up vote
                2
                down vote









                Properties are case sensitive



                For example change empleado.nombre to empleado.Nombre



                 <tr *ngFor="let empleado of empleados">
                <td>{{empleado.Nombre}}</td>
                <td>{{empleado.Codigo}}</td>
                <td>{{empleado.Posicion}}</td>
                <td>{{empleado.Oficina}}</td>
                <td>
                <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
                <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
                </td>
                </tr>





                share|improve this answer












                Properties are case sensitive



                For example change empleado.nombre to empleado.Nombre



                 <tr *ngFor="let empleado of empleados">
                <td>{{empleado.Nombre}}</td>
                <td>{{empleado.Codigo}}</td>
                <td>{{empleado.Posicion}}</td>
                <td>{{empleado.Oficina}}</td>
                <td>
                <button class="btn btn-primary"> <i class="fa fa-save"></i></button>
                <button class="btn btn-danger"> <i class="fa fa-trash-o"></i></button>
                </td>
                </tr>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 22 at 17:46









                Code-EZ

                3,24083052




                3,24083052






















                    up vote
                    0
                    down vote













                    why are you displaying alert msg in Service. It should be added in Component.



                    did console.log in service returns result? If yes, try with below code.



                    Component:



                    traerEmpleados() {
                    this.empleadoServ.getEmpleados()
                    .subscribe( (resp: any) => {
                    this.empleados = resp;
                    });
                    }





                    share|improve this answer





















                    • It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                      – Leonardo B
                      Nov 22 at 17:54















                    up vote
                    0
                    down vote













                    why are you displaying alert msg in Service. It should be added in Component.



                    did console.log in service returns result? If yes, try with below code.



                    Component:



                    traerEmpleados() {
                    this.empleadoServ.getEmpleados()
                    .subscribe( (resp: any) => {
                    this.empleados = resp;
                    });
                    }





                    share|improve this answer





















                    • It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                      – Leonardo B
                      Nov 22 at 17:54













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    why are you displaying alert msg in Service. It should be added in Component.



                    did console.log in service returns result? If yes, try with below code.



                    Component:



                    traerEmpleados() {
                    this.empleadoServ.getEmpleados()
                    .subscribe( (resp: any) => {
                    this.empleados = resp;
                    });
                    }





                    share|improve this answer












                    why are you displaying alert msg in Service. It should be added in Component.



                    did console.log in service returns result? If yes, try with below code.



                    Component:



                    traerEmpleados() {
                    this.empleadoServ.getEmpleados()
                    .subscribe( (resp: any) => {
                    this.empleados = resp;
                    });
                    }






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 22 at 17:41









                    Suresh Kumar Ariya

                    4,2251215




                    4,2251215












                    • It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                      – Leonardo B
                      Nov 22 at 17:54


















                    • It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                      – Leonardo B
                      Nov 22 at 17:54
















                    It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                    – Leonardo B
                    Nov 22 at 17:54




                    It always get error, the problem that i see, it's maybe in the types, when I write console.log(this.empleados[0].nombre); it appears in the console "undefined"
                    – Leonardo B
                    Nov 22 at 17:54


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435953%2fangular-employees-does-no-appear-in-component%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Trompette piccolo

                    Slow SSRS Report in dynamic grouping and multiple parameters

                    Simon Yates (cyclisme)