matth3o matth3o - 1 month ago 25
Dart Question

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

Answer

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>
Comments