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
Erik Anderson
NA
4
572
Set a name rather than a number for ID:s returned as strings
Apr 21 2021 1:08 PM
I've a function which returns a list of ID:s as strings. Now it prints out 1,2,3 etc
I would like to name each string rather than having it as numbers like:
1 == 'NameOne'
2 == 'NameTwo'
3 == 'NameThree'
x.component.ts
printUser(ids: number[]): string {
return
ids.sort().join(
', '
);
}
x.component.html.ts
<div *ngIf=
"x.users.length > 0"
> User:
{{ printUser(x.user) }}
</div>
Reply
Answers (
1
)
How to groupby in typescript
How to delete the column value in angular