I have some difficulties to understand how the ngFor works with map.
So this is my HTML code:
<div *ngFor="let country of wars.getCountrys()">
and here my TypeScript code:
wars: Map < number, Array < country> > = new Map < number, Array < country > > ();
getCountrys() {
console.log('getCountrys()');
return Array.from(this.wars.keys());
}
Everything is working good, however in the console I have 2 getCountrys()
I don't understand why the function getCountrys()
is called 2 times.