angularjs – 带有templateParameter属性的Angular google map w
发布时间:2020-12-17 06:47:14 所属栏目:安全 来源:网络整理
导读:我正在使用 Angular-google-map库来显示带有这样的窗口的标记: google-map center="map.center" zoom="map.zoom" draggable="true" bounds="" options ="{styles:map.options}" marker ng-repeat="hotel in hotelsFiltered" idKey="hotel.id" coords="{lati
我正在使用
Angular-google-map库来显示带有这样的窗口的标记:
<google-map center="map.center" zoom="map.zoom" draggable="true" bounds="" options ="{styles:map.options}" > <marker ng-repeat="hotel in hotelsFiltered" idKey="hotel.id" coords="{latitude:hotel.latitude,longitude:hotel.longitude}" hoteldata="hotel" icon="icon"> </marker> <window ng-repeat="hotel in hotelsFiltered" coords="{latitude:hotel.latitude,longitude:hotel.longitude}" templateUrl="hotel.templateUrl" templateParameter="{title:'myTitle'}" show="hotel.show" > </window> </google-map> 所以在window指令中我提供了templateUrl,并且标记成功显示了信息窗口,但问题是我在templateParameter中提供的参数似乎无法在模板视图中访问. <div> {{title}} the title was not showed successfully </div> 解决方法
我有一个非常类似的问题,解决方案是更新模板中的绑定,如下所示:
<div> {{parameter.title}} </div> 其余代码可以保持不变. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |