I am receiving an array of data from the backend and looking for a way to display them in a vertical list using HTML. Can anyone help me with this? Below is my current code snippet.
TS:
this.sub = this.route.params.subscribe(params => {
this.http.get<Organization>('/api/organization/get-details', {
params: {
username: params.orgUsername
}
})
.subscribe(organization => {
this.organization = organization['orgDetail'];
this.users = organization['usernames'];
The variable this.users
contains a list of usernames that I want to display vertically, one below the other.
HTML code:
<span style="display:flex; margin-top: 10px;">
<mat-icon style="font-size:20px;">person</mat-icon>{{users}}</span>
Desired output:
username1
username2 ..