matth3o matth3o - 1 year ago 141
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.


Answer Source

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]}}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download