I am trying to get first object from the nested json in angular2. Can any one help me in fetching first json object.
Sample Json:
var Datalist = [{"id":1,"status":"completed"},{"id":2,"status":"Not completed"},{"id":3,"status":"Not completed"}]
My angular code:
<ul class="list-group">
<li *ngFor="let c of Datalist"
class="list-group-item">
<label> {{c.status}} </label>
<span class="pull-right">{{c.id}}</span>
</li>
</ul>
Now i am getting all 3 id's and status's. I just want first object,1,completed