I have html file where im calling get method getDate
. Im trying to retrive data from database and add value to return statment. I having issue that im retriving return 'date' without start value. I added logs and it will print first 'outside' and then 'inside' thats the reason why its only returning 'date' without start. Is there any way how can I retrive full return statment after data are retrived from database?
Html code:
<template v-slot:no-data>
<div v-on="scope.on" style="cursor: pointer;text-decoration:underline>{{getDate}}</div>
</template>
Typescript code:
public get getDate()
{
Service.getData(id)
.then((response) => {
console.log('inside');
start = response[0].start;
end = response[0].end;
});
console.log('outside');
return 'date ' + start;
}