title: Angular RxJS mergeMap types
body: <p>Trying to pull the longitude and latitude from a geo location service into <code>list.service</code> using <code>http.get</code> request URL.</p>
  
  <p>First issue:</p>
  
  <blockquote>
    <p>businesses Property 'businesses' does not exist on type '{}'</p>
  </blockquote>
  
  <p>Appreciate the help on this issue and the time</p>
  
  <p><code>list.service.ts</code>:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Observable } from 'rxjs';
  import { List } from '../models/list.model';
  import { map } from 'rxjs/operators';
  import { GeolocationService } from '../services/geolocation.service';
  import { mergeMap } from 'rxjs/operators';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable()
  export class ListService {
      private serverApi = 'http://localhost:3000';
  
      constructor(private http: HttpClient, private geoServ: GeolocationService) { }
  
      public getAllLists(): Observable&lt;List[]&gt; {
          return this.geoServ.getGeoLocation().pipe(
            mergeMap&lt;{businesses: List[]}&gt;(({ latitude, longitude }) =&gt;             
              this.http.get(`${this.serverApi}/yelp/${longitude}/${latitude}`).pipe(
              )
            ),
            map(res =&gt; res.businesses));
      }
  }
  </code></pre>
  
  <p><code>geolocation.service.ts</code>:</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent, SubscriptionLike, PartialObserver } from 'rxjs';
  @Injectable({
    providedIn: 'root'
  })
  export class GeolocationService {
  
    constructor() { }
  
    getGeoLocation() {
      return new Observable((observer) =&gt; {
        console.log('Geolocation working!');
        const options = {
          enableHighAccuracy: true,
          timeout: 5000,
          maximumAge: 0
        };
        const success = (pos) =&gt; {
          const crd = pos.coords;
          console.log(`Longitude : ${crd.longitude}`);
          const location = {
            "latitude" : crd.longitude,
            "longitude": crd.longitude
          };
          observer.next(location);
          observer.complete();
        };
        const error = (err) =&gt; {
          console.warn(`ERROR(${err.code}): ${err.message}`);
          observer.error(err);
          observer.complete();
        };
        navigator.geolocation.getCurrentPosition(success, error, options);
      });  
    }
  }
  </code></pre>
  
  <p><code>list.model.ts</code>:</p>
  
  <pre><code>export interface List {
      id: string;
      name?: string;
      rating?: number;
      review_count?: number;
      url?: string;
      location: string;
      display_name?: string;
      image_url?: string;
      is_closed?: boolean;
  }
  </code></pre>
  
  <p>Added <code>model.ts</code> to help clarify</p>