Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to use cordova plugins with ionic 2 and ts?

$
0
0

@kurtommy wrote:

Hi,
I'm starting to deal with ionic 2 with typescript. I'd like to add this plugin

ionic plugin add cordova-plugin-geolocation

but typescript complain for this code
let watch = Geolocation.watchPosition();
watch.subscribe((data) => {
//data.coords.latitude
//data.coords.longitude
console.log(data)
});

because the lack of missing type, i've tried with this Geolocation: any; but doesn't work

I'm new of typescript. There is a guide/example/tutorial on how to do that?

Many thanks

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>