matth3o
matth3o

Reputation: 3659

dart angular2 - iteration in template

I'd like to iterate each type of : List<Map<String, List<String>>> in my angular2 template.

How can i do that ?

I guess for the list I can do <div *ngFor="let listItem of myListOfMap">, but I have no idea for the map inside.

Thanks

Upvotes: 1

Views: 99

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657028

Just iterate over the keys of the map and then you can use the key to access the value:

<div *ngFor="let listItem of myListOfMap">
  <div *ngFor="let key of listItem.keys">
    {{key}} : {{listItem[key]}}
  <div>
</div>

Upvotes: 4

Related Questions