I assume that you conclude that this is not the job of this.location, because your user interface is not updating. Confirm if this.location is set by adding another console log to setPosition.
console.log(this.location);
, , , . , , , ,
setTimeout( position => this.location = position.coords, 0);
, . setPosition ngOnInit , 'ngAfterViewChecked' 'ngDoCheck', , ,
ngOnInit(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(this.setPosition.bind(this));
};
}
}
Bing , , argument