My parent JS code is:
@api recordId;
getMapData(){
fetchdata()
.then(result => {
this.data = result;
this.error = null;
console.log('Data Connected callback' + JSON.stringify(this.data));
this.recordId = this.data[0].Id;
})
.catch(error =>{
this.error = error;
this.errorMsg = error;
this.isEmpty = true;
});
}
connectedCallback(){
this.getMapData();
}
Parent HTML :
<template>
<c-map-field-table get-id-from-parent={recordId} ></c-map-field-table>
</template>
Child JS :
@api getIdFromParent;
getIdFromParent value is 'undefined'