html - 我想制作对象并将其绑定到打字稿中的html
问题描述
我想制作对象并将其绑定到打字稿中的 html 文件中。这段代码是 javascript 格式,所以我应该怎么做才能创建一个对象并将其绑定到 html 文件中。
<map>
<div>
<div #map style="position:relative;width:100%;min-width:290px;height:600px;"></div>
</div>
<div>
<button (click)="searchAddress()">Search</button>
</div>
</map>
showPopup(e): void {
//Get the properties and coordinates of the first shape that the event occurred on.
var p = e.shapes[0].getProperties();
var position = e.shapes[0].getCoordinates();
//Create HTML from properties of the selected result.
var html = `
<div style="padding:5px">
<div><b>${p.poi.name}</b></div>
<div>${p.address.freeformAddress}</div>
<div>${position[1]}, ${position[0]}</div>
</div>`;
//Update the content and position of the popup.
this.popup.setPopupOptions({
content: html,
position: position
});.
解决方案
推荐阅读
- kendo-ui - 剑道图表动态系列来自类别、价值、系列名称
- python - pandas loc 然后 iloc 用于选择特定的列和行不起作用
- snowflake-cloud-data-platform - 是否可以使用数据共享来共享视图
- mysql - 将数据库上传到 GitHub
- php - php 注意:试图访问 null 类型值的数组偏移量
- javascript - 以希伯来语存储的 Cookie 在页面上显示为乱码
- javascript - 无法在屏幕 ReactJS 上显示 SVG 图像
- python - 在 C 结构中保存一个 numpy 数组
- java - 对象可以调用它被实例化的类中的方法吗?
- kubernetes - Kubernetes 单节点集群:部署新镜像后 dns 不工作