- , , , , script , zone.js. , script . Google . ....
, , ngZone.run.
- , , - , runOutsideAngular. , .
, , , Angular. runOutsideAngular, Angular run.
, , , -two- way (ngModel). , , . , ngZone.run. , changeRef.detectChanges , ApplicationRef tick(). data goes down, events go up.
constructor(private appRef: ApplicationRef){}
getLocation(address: string): void {
let mygc = new google.maps.Geocoder();
mygc.geocode({
'address': address
}, (results, status) => {
let data: any = results[0];
this.myObject.myData = {
lat: data.geometry.location.lat(),
lng: data.geometry.location.lng()
};
this.appRef.tick();
});
}
, , , ngZone.run. , , , google.maps events/addEventListener. , zone.js, Angular, .
, , ngZone.run, ApplicationRef.tick. , ngZone.run , () Angular, .
"" NgZone api