Retrieve single JSON element in an JSON object in angular 2
<p>I have a JSON  as </p>

<pre><code>   labelnames={
    "one": "",
    "two": "",
    "three": "",
    "four": ""
};
</code></pre>

<p>Now i have separate condition for each <code>labelname</code>. So, if i wish to display <code>labelname[0]</code> i.e., "one" and use it, then what is the way i should follow?</p>

<p>I tried using pipes and ngfor loop, but i am getting all values in labelnames</p>

<pre><code> &lt;li *ngFor="let doc of labelnames | keys"&gt;
 {‌{doc.key}}
&lt;/li&gt;
</code></pre>

<p>I just need single element depending on index.</p>

<p>Help me in solving this.</p>