Created
November 1, 2017 13:34
-
-
Save nicobytes/3f5574ca1fce6f489f7ec610aade42f0 to your computer and use it in GitHub Desktop.
watchPosition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Geolocation } from '@ionic-native/geolocation'; | |
... | |
constructor(private geolocation: Geolocation) {} | |
... | |
let watch = this.geolocation.watchPosition(); | |
watch.subscribe((data) => { | |
// data can be a set of coordinates, or an error (if an error occurred). | |
// data.coords.latitude | |
// data.coords.longitude | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment