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>