title: Write Geolocation API as promise or observable for Angular
body: <p>I am using Angular 6 and need to get location data in a promise. The <code>geolocation API</code> has a callback for success and error <code>navigator.geolocation.getCurrentPosition(successCallback, errorCallback);</code></p>
  
  <p><a href="https://w3c.github.io/geolocation-api/#geolocation_interface" rel="nofollow noreferrer">w3c Geolocation API</a></p>
  
  <pre><code>[NoInterfaceObject]
  interface Geolocation {
    void getCurrentPosition(PositionCallback successCallback,
    optional PositionErrorCallback errorCallback,
    optional PositionOptions options);
  
    long watchPosition(PositionCallback successCallback,
    optional PositionErrorCallback errorCallback,
    optional PositionOptions options);
  
    void clearWatch(long watchId);
  };
  </code></pre>
  
  <p>How would I write a promise or observable for Angular that utilized the success and error callbacks?</p>