加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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中提供的参数似乎无法在模板视图中访问.
这是我的infoWindow的模板视图以及我如何尝试从window指令访问传递的参数:

<div>
 {{title}}
 the title was not showed successfully 
</div>

解决方法

我有一个非常类似的问题,解决方案是更新模板中的绑定,如下所示:

<div>
   {{parameter.title}}
</div>

其余代码可以保持不变.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读