0
我的要求是当我点击谷歌地图上的某些标记时,地点必须在引导列表中更新。但是,当我点击阵列更新,但列表不会在bootstrap更新。当我使用infowindow一切正常。地图标记和引导列表
HTML
<div class="panel-body">
<ul style="padding-left:0px;">
<li class="list-group-item list-group-item-info" ng-repeat="x in routesub" style="font-size:smaller;">
<span class="badge" ng-click="delloc(x)">x</span>
{{x}}
</li>
</ul>
<button class="btn btn-danger btn-sm" ng-click="subsearch()">SUBSCRIBE</button>
</div>
app.js
google.maps.event.addListener(marker, 'click', (function (marker, i) {
return function() {
// var content1 = "<div><h6><font color='black'>" + locations[i].Name + "</font></h6><input type = 'button' class = 'btn btn-success btn-sm' value = 'Select' ng-click = 'SubLoc();' /></div>";
//var content = $compile(content1)($scope);
//$scope.infowindow.setContent(content[0]);
//$scope.infowindow.open($scope.map, marker);
$scope.SubLoc = function() {
if ($scope.routesub.indexOf(locations[i].Name) == -1) {
$scope.routesub.push(locations[i].Name);
$scope.routeidsub1.push(locations[i].LocationId);
marker.setIcon(icon_sel);
// $scope.infowindow.close();
}
else {
//$scope.infowindow.close();
}
}
$scope.SubLoc();
}
})(marker, i));
当我注释掉那些评论零部件和使用信息窗口一切perfecftly制定。当我点击标记时发表评论时,数据存储在$scope.routesub
中,但在html中不可见。帮助我
谢谢Danscho。现在它工作正常 – Alan