I can't iterate over an array of objects. In each object, I have a name, but I can't get the text of the object or the name inside it.
I have the following code in my ts file
retrieveMultiple(config, "accounts")
.then(
(results) => {
const accounts: any[] = [];
for (let record of results.value) {
accounts.push(record);
}
this.accounts= accounts;
console.log(accounts[0].name);
console.log(accounts);
},
(error) => {
console.log(error);
}
And I have this in my HTML file:
<p>Accounts:</p>
<ul>
<li *ngFor="let account of accounts | json">
{{ account.name }}
</li>
</ul>