How can I get value with angular / typescript in this table ..
How can I get the value of code and label .. I tried to do this code but it's not worked :
MyComponent.ts
jsonsTypes = []; // define here global variable
saveFolder() {
let tab = [];
this.adminService.getLabelByCode(code).subscribe(
labelByCode => {
tab.push({
'code': code,
'label': labelByCode.label
});
});
this.jsonTypes.push(tab);
//here when I do console.log(tab); ==> I have the result of the picture
for (var index = 0; index < this.jsonTypes.length; index++) {
console.log(jsonTypes[index]);
console.log(jsonTypes[index].code); // ==> undefined
// How can I get value ?
}
}