0

I have a simple test Immutable.js Map:

this.numberMap = Immutable.Map({
                first: 1, second: 2, third: 3, big: 100000
            });

Now I try to iterate over this Map with Angular's *ngFor:

<div *ngFor="let n of numberMap">
    {{n}}
</div>

It appears that n is referencing whole entry (key + value), and prints key separated by coma then value. I am unable to access this value, I was unable to find a way to access key or value part of n in any way, is there any way to access these separately?

I tried to iterate with for each over this map to find the value/key properties but forEach unfortunately iterates only through value.

Jarek
  • 7,425
  • 15
  • 62
  • 89

1 Answers1

0

Thanks to comments I learned that this pair is returned as normal Array with two entries, so you can access key as n[0] and value as n[1].

Jarek
  • 7,425
  • 15
  • 62
  • 89