ahmed elbarbary

ahmed elbarbary

  • 1.1k
  • 892
  • 37.2k

How to convert URL cell text as small link when press on it

May 20 2020 6:12 PM

How to convert cell text as link when press on it open on URL browser on angular 7 ?
I have cell text for column offilneURL text inside cell display URL as text
I need to convert text or replace text with link then when press on it redirect to URL direct .
component.html
  1. <tbody>  
  2. <ng-container *ngFor="let repcon of ReportControl">  
  3. <ng-container *ngFor="let repdata of ReportData">  
  4. <tr *ngFor="let rep of reportdetailslist">  
  5.   
  6. <td *ngFor="let coln of headerCols">  
  7.   
  8.   
  9. <span>  
  10.   
  11.   
  12. {{rep[coln]}}  
  13. </span>  
  14. <div *ngIf="coln==repcon.fieldName">  
  15. <div *ngIf="repcon.columnType==1">  
  16. display text as link url  
  17. </div>  
  18.   
  19. </div>  
  20. </td>  
  21. </tr>  
  22. </ng-container>  
  23. </ng-container>  
  24. </tbody>  
Sample data
  1. RevisionId offilneURL  
  2. 122345 https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF  
display text as link url
Above exactly current status of data I Expected to be :
  1. RevisionId offilneURL  
  2. 122345 URL link  
Small shortcut name when click on it redirect to link URL above . I need to make as URL for two reason :
first is it take too much space .
second i can click link direct without copy and past URL browser .

Brought to you by:

Answers (1)