How to stop the code from being execute or wait for a first line to completely execute

Okay so what I want to do is wait for a location service to fetch the coords and then I’m going to execute my other functions(lines of code).

//in my TS file.
.then(() => {


    //Execute this function only when you have got the coords from this locService.

  }, error => this.ui.showToast('Please enable GPS location', false, '')

IN my Service file

  .filter((p) => p.coords !== undefined) //Filter Out Errors
  .subscribe(position => {
    console.log(position.coords.latitude + ' ' + position.coords.longitude); = position.coords.latitude;
    this.lng = position.coords.longitude;


What to do ?
Please help, I think this can be achieved using async/await but I dont know how to use them?

Put the subscribe in the calling ts and let the service return the obervable