This is a continuation from this question: How to display comma delimited JSON value as a list?
I have this array:
var ARTISTS: Artist[] = [
{
"name": "Barot Bellingham",
"shortname": "Barot_Bellingham",
"reknown": "Royal Academy of Painting and Sculpture",
"bio": "Some bio here...",
"friends": [
"james",
"harry",
"bob"
]
},
// etc...
]
And I need to display "friends" as an ordered list. I'm doing so like this:
<li *ngFor="let friend of artist.friends">{{friend}}</li>
This works perfectly, but, I now need to restructure my data so that there is no nested array:
var ARTISTS: Artist[] = [
{
"name": "Barot Bellingham",
"shortname": "Barot_Bellingham",
"reknown": "Royal Academy of Painting and Sculpture",
"bio": "Some bio here...",
"friends": "James, Harry, Bob"
}
How can I continue to display each friend as separate list items, such as:
<ol>
<li>James</li>
<li>Harry</li>
<li>Bob</li>
</ol>
Thank you!