не получается обновить значение переменной в ионном - PullRequest
0 голосов
/ 18 мая 2018

Это мой код в поставщике locationtracker.ts

 watch: any;
lat: number=0;
lng: number=0;

this.watch = this.geolocation.watchPosition().filter((p) => p.coords !== undefined).subscribe(position => {
  this.lat = position.coords.latitude;
  this.lng = position.coords.longitude;
  this.msg = "front"+position.coords.latitude;
  this.id = 2;
  console.log(this.lat);
  this.showNotification();
  console.log(this.lng);
});

Это мой код для получения значения lat lng.

this.lat = this.locationTracker.returnLat();
this.lng = this.locationTracker.returnLng();

Но я получаю только 0 значение вширота, не обновленное значение.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...