0

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; 
}
zon1k
  • 87
  • 7
  • Also possibly relevant: [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) – Ivar Dec 10 '22 at 00:04

0 Answers0