This is probably an easy answer, but I already spent days trying to figure it out, without any success.
An HTTP GET returns this body response:
{"members":[{"id":1484,"organization_id":3},{"id":1777,"organization_id":3},{"id":2214,"organization_id":3},{"id":2261,"organization_id":3}]}
I try to iterate trough it in Angular2:
getMembers() {
this.http.get('http://server/user/members')
.map(res => res.json())
.subscribe(
data => this.members = data.members
);
}
How can I loop through members and read their property? The html template can do it perfectly well:
<li *ngFor="let m of session.members">
{{m.id}}
</li>