TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278.3k
How to make field passed to function goToLink dynamically ch
May 26 2020 1:44 AM
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))
Reply
Answers (
1
)
error property subscribe doesn’t exist on type void when sub
I try to make left side menu Collapse as accordion in angula