【发布时间】:2018-11-10 16:04:06
【问题描述】:
我想在 ionic 上做这样的事情
但是我在添加 infoWindows 按钮时遇到了问题,
特别是在本节中(click)="ir()"(角度)
ir(){
console.log("go");
}
addMarker(position,map,title){
var marker = new google.maps.Marker({
position,
map,
title
});
var infoWindow = new google.maps.InfoWindow({
content:" "
});
marker.addListener('click',function(){
infoWindow.setContent('<h1> '+ title +'</h1>' +
'<button class="mapaboton" (click)="ir()">Ver Detalles</button>');
infoWindow.open(map,this);
});
}
对不起我的英语
当我点击它时,什么也没有发生。
然后我将(click)="ir()" 更改为onclick="ir()",它会抛出下一个错误
(index):1 Uncaught ReferenceError: ir is not defined 在 HTMLButtonElement.onclick ((index):1)
【问题讨论】:
标签: javascript angular ionic-framework google-maps-markers