<p dir="auto">I'm submitting a "feature request"</p>
<p dir="auto">FEATURE REQUEST: enable support "ngForIn"</p>
<p dir="auto">currenly, *ngFor can only support "of" keyword which loops array like iterables. "in" keyword will throw a parsing error.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<ol dir="auto">
<li>"in" keyword is supported natively in JavaScript to iterate own (not inherited) property in objects.<br>
for example:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" for(let key in object){
       console.log( object[key] );
  }"><pre class="notranslate"><code class="notranslate"> for(let key in object){
       console.log( object[key] );
  }
</code></pre></div>
<ol start="2" dir="auto">
<li>
<p dir="auto">Using object key to store information rather than array will achieve O(1) lookup time. If the order of the information does not matter, object is arguably better data structure in many cases. However, if we return JSON that stores data purely in object format, we cannot use ngFor to iterate it, at least not before we convert.</p>
</li>
<li>
<p dir="auto">This concept has been found in firebase<br>
e.g.</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    countries:[&quot;USA&quot;, &quot;Canada&quot;] 
}  
"><pre class="notranslate"><code class="notranslate">{
    countries:["USA", "Canada"] 
}  

</code></pre></div>
<p dir="auto">*ngFor="let  country of countries"</p>
<p dir="auto">  {{country }}  </p>   
 .......(current support)
<p dir="auto">==&gt;&gt;</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    countries:{
         USA:true,
         Canada: true
   }
}"><pre class="notranslate"><code class="notranslate">{
    countries:{
         USA:true,
         Canada: true
   }
}
</code></pre></div>
<p dir="auto">*ngFor="let country in countries"</p>
<p dir="auto">{{ country }}</p>
 ..... (requested feature)
<p dir="auto">These 2 will print exactly the same thing.</p>
<p dir="auto">I am trying to iterate over  <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="nofollow">Map</a> values with the built in <code class="notranslate">ng-for</code>, but I can see that for some reason it is not working.</p>
<p dir="auto">In the specs, you can iterate over a Map iterable with:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let map = new Map();
let values = map.values();
for (let item of values) {
    console.log(item);
}"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">map</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Map</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-s1">map</span><span class="pl-kos">.</span><span class="pl-en">values</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">item</span> <span class="pl-k">of</span> <span class="pl-s1">values</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">And none of the ES5 standard <code class="notranslate">for (...)</code>/<code class="notranslate">for (... in ...)</code> will work with that.</p>
<p dir="auto">Does the built in <code class="notranslate">ng-for</code> actually support iterating over maps?</p>