Click here to Skip to main content
15,883,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I work on angular 7 I face Issue I need to display offlineurl as download Link where it

Exist on report control table and columnType=1 .

ReportId    FieldName   ReportStatus    ColumnType
2028        offilneURL    Link             1
2028        onlineURL     Hidden           2

so I try to make it as below :


my stack-blitz sample as below :

https://stackblitz.com/edit/create-ijwgfx?file=app%2Fapp.component.ts

Expected Result :

on column offlineurl (five column from left ) it display as

https://source.z2data.com/2019/1/13/8/55/47/351/662203977/21527_SPCN.PDF

I need to show it as

download link name when click on it it will display link above on browser

where Exist on report control table

What I have tried:

JavaScript
<tr *ngFor="let rep of contentBody">

                  <td *ngFor="let coln of headerCols">

                    // replace coln !=='offilneURL' with (reportcontrol.field name and columnType=1)
                    <span *ngIf="coln !== 'offilneURL'">
                      {{rep[coln]}}
                    </span>

                    <ng-container *ngFor="let repcon of ReportControl">

                      <div *ngIf="coln==repcon.fieldName">


                        <div *ngIf="repcon.columnType==1">

                          <a (click)="goToLink(rep.offilneURL)"></a>

                        </div>
                      </div>
                    </ng-container>
                    </td>
                  </tr>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900