I want to choose the Objects that I want to put in the tasks array according to IdEmployee Im trying to display the content of data (in which there is the field "IdEmployee"), but when I display it, I can see : data.IdEmployee = undefined
In the html file, I can see the entire array from my database
@Component({
selector: 'app-display-tasks',
templateUrl: './display-tasks.component.html',
styleUrls: ['./display-tasks.component.css']
})
export class DisplayTasksComponent implements OnInit {
constructor(private http:HttpClient) { }
tasks:any=[]
ngOnInit(): void {
this.refreshList();
}
refreshList(){
this.http.get<any>(environment.API_URL+'task')
.subscribe(data=>{
this.tasks=data;
alert("data.IdEmployee = "+data.IdEmployee)
})
}
}