How to display offlineurl as download link where exist on report control Table and columnType=1?

12 views
Skip to first unread message

ahmed elbarbary

unread,
Jun 15, 2020, 1:46:49 AM6/15/20
to Angular and AngularJS discussion

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 :

 <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>

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

Updated Post to clear What I need

enter image description here


bastien lemaire

unread,
Jun 15, 2020, 2:23:33 AM6/15/20
to ang...@googlegroups.com
Hi,

You need to use the anchor tag to get this the way you want: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a

<a href="http://google.com">Download Link</a>

The above will display "Download Link" (without the quotes) and will have the desired link like style. A click on that link will open the url specified in the href attribute
Hope this helps

Bastien Lemaire


--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/f4145fce-fc5f-46cf-80a9-d591c0514ff4o%40googlegroups.com.

ahmed elbarbary

unread,
Jun 15, 2020, 5:06:09 AM6/15/20
to Angular and AngularJS discussion

can you help me 
my problem not on anchor tag 
my main issue how to replace
static field 'offline
by reportcontrol.fieldname'
Reply all
Reply to author
Forward
0 new messages