【发布时间】:2023-03-21 04:20:01
【问题描述】:
我有一个信息窗口。我正在尝试基于复选框调用函数。这是我的代码
$scope.showDetails = function(e, pothole) {
console.log(pothole);
var infowindow = new google.maps.InfoWindow();
var center = new google.maps.LatLng(pothole.lat,pothole.lng);
infowindow.setContent(
'<label class="switch">'+
'<input ng-model="mycheckbox" ng-change = "remove(pothole.lat,pothole.lng,mycheckbox)" type="checkbox" checked />'+
'<span class="slider round"></span>'+
'</label>');
infowindow.setPosition(center);
infowindow.open($scope.map);
};
我在作用域上有那个删除方法。但它没有被调用。这是代码
$scope.remove = function(lat, long,mycheckbox){
alert(mycheckbox);
}
有人可以帮助我吗?谢谢
【问题讨论】:
-
您是否尝试过删除 html 字符串中的空格?
ng-change = "remove到ng-change="remove
标签: javascript angularjs infowindow ng-map