Last active
June 23, 2017 20:10
-
-
Save matthieu-D/fc22a9ffd697488e3f78bc3325c362f4 to your computer and use it in GitHub Desktop.
use geoloc
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 { Platform } from 'ionic-angular'; | |
import { Geolocation } from '@ionic-native/geolocation'; | |
. | |
. | |
. | |
export class MyApp { | |
rootPage:any = HomePage; | |
constructor(platform: Platform, geolocation: Geolocation) { | |
platform.ready().then(() => { | |
geolocation.getCurrentPosition().then((location) => { | |
console.log(location); | |
}).catch((error) => { | |
console.log('Error getting location', error); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment