これを試してみてください:
は
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Geolocation } from '@ionic-native';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
coords:any;
accuracy:any;
error:any;
constructor(public navCtrl: NavController) {
}
watch(){
Geolocation.getCurrentPosition().then(resp) => {
this.coords= resp.coords.latitude+' '+resp.coords.longitude;
this.accuracy= resp.coords.accuracy+' '+'meters';
}).catch((error)=>{
this.error='Error getting location'+error;
})
}
}
これらは簡単でエラーログです//
watch(){
Geolocation.getCurrentPosition().then((resp) => {
this.coords= resp.coords.latitude+' '+resp.coords.longitude;
this.accuracy= resp.coords.accuracy+' '+'meters';
}).catch((error)=>{
this.error='Error getting location'+error;
});
}
を私はあなたが不足していると思います「。 "キャッチした後も、 "("、その後の後。
感謝を持っているでしょう。私の悪い。 – camoflage
あなたは」再歓迎:) –
VSCodeなどの互換性のあるIDEを使用するので、手動でエラーを特定する必要はありません。 – unional