在角7的URL浏览器上按下单元格文本作为链接是如何转换的?
我有单元格文本作为列的offilneURL文本在单元格中显示为
我需要转换文本或替换链接文本,然后按下它重定向到URL直接。
component.html
<tbody>
<ng-container *ngFor="let repcon of ReportControl">
<ng-container *ngFor="let repdata of ReportData">
<tr *ngFor="let rep of reportdetailslist">
<td *ngFor="let coln of headerCols">
<span>
{{rep[coln]}}
</span>
<div *ngIf="coln==repcon.fieldName">
<div *ngIf="repcon.columnType==1">
display text as link url
</div>
</div>
</td>
</tr>
</ng-container>
</ng-container>
</tbody>样本数据
RevisionId offilneURL
122345 https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF
display text as link url以上正是我所期望的数据的当前状态:
RevisionId offilneURL
122345 URL link小快捷方式名称时,点击它重定向到链接URL以上。我需要作为URL有两个原因:
首先,它占用太多的空间。
其次,我可以直接点击链接没有复制和过去的URL浏览器。
更新的
通过{{rep.offilneURL}访问每个链接上的url
您能告诉我如何传递{{rep.offilneURL}并以url的形式打开并具有简短的名称描述吗?
发布于 2020-05-21 00:30:17
首先,js中没有按源事件,但是您可以使用单击事件,比如dom.Click =function (e) {}。您可以在参数e中获取url文本,然后调用window.open (url)跳转。
https://stackoverflow.com/questions/61924417
复制相似问题