I work on angular 7 app I face Issue I can't pass field name dynamically from repcon.fieldname to goToLink .
rep.offlineURL is static field so i need replace offlineURL with repcon.fieldname that return offlineURL
on function goToLink I need to replace goToLink(rep.offlineURL) with goToLink(rep.(repcon.fieldname))
ReportControl return the following :
- [{"reportid":"5","fieldname":"offlineURL","columnType":"1"},{"reportid":"5","fieldname":"onlineURL","columnType":"2"}]
component.html
- <ng-container *ngFor="let repcon of ReportControl">
-
- <div *ngIf="coln==repcon.fieldName">
-
-
- <div *ngIf="repcon.columnType==1">
-
- <a (click)="goToLink(rep.offilneURL)"><i nbTooltip="DownloadData" nbTooltipPlacement="bottom" nbTooltipStatus="primary"><nb-icon icon="cloud-download-outline"></nb-icon> </i></a>
-
- </div>
- </div>
- </ng-container>
on component.ts
- goToLink(url: string){
- window.open(url, "_blank");
- }
- I Expected :
-
- goToLink(rep.(repcon.fieldname))