I am using angular 7 and I am displaying some data.
Here are the parts:
myData: any;
The content of myData is:
{
"id" : "1",
"name" : "Name 1",
"stuff" : [
{
"cmd" : "something here"
},
{
"cmd" : "something else here"
}
]
}
Then is my app.component.html I have:
<ul class="code-editor-options-menu" *ngFor="let dat of myData">
<li>
<span>{{dat.name}}</span>
<span aria-hidden="true">{{dat.stuff.cmd}}</span>
</li>
</ul>
With this: {{dat.stuff.cmd}} I'm trying to list all of the items inside stuff.
How can I do that?
myData? Is it a single JSON as you shown or is it actually an array of objects?