1
일부 각도 속성을 * ng로 연결하려고하는데 전혀 작동하지 않습니다.마커 수신기의 각도 NgZone
loadMap() {
this.map = new google.maps.Map(document.getElementById('map'), this.mapOptions);
google.maps.event.addListenerOnce(this.map, 'idle',()=>{
this.addMarkers()
});
}
그리고 addMarkers() 함수 :
addMarkers() {
var me = this;
this.restaurants.map(restaurant => {
new google.maps.Marker({
position: new google.maps.LatLng(restaurant.location.latitude, restaurant.location.longitude),
map: this.map,
animation: google.maps.Animation.DROP,
name: restaurant.id
})
.addListener('click', function() {
me.ngZone.run(() => {
this.restaurantSelected = restaurant
console.log(this.restaurantSelected);
});
});
});
}
이
그의 문제에도 ngZone.run 내부()이
나는 당신이 내 코드를 먼저 내 loadMap 기능을 보여줍니다 구성 요소가 아니라 마커를 참조하고 있습니다. 어떻게 문제를 해결할 수 있을지 모르겠다.
미리 감사드립니다.
감사합니다.
감사합니다 유지하는 기능을 발현하는 대신 화살표 기능을 사용! 지금 일하고있는 thats. – Bruno