I am trying to bind nested json object in my angular application. Here
component.html file
<div class="row">
<ul class=" g-img col-md-3 col-sm-3 col-xs-12" *ngFor="let data of ruleTypeList">
<li *ngFor="let group of data.AnalyticsGroup; let i = index">
<div class="object-box noti-box col s s1 home-box" >
<p>{{data.RuleName}}</p>
<p>{{group.GroupName}}</p>
<div>
<p>Overall Count: {{getCount(group.Id)}}</p>
</div>
</div>
</li>
</ul>
</div>
I am getting repetative id's as shown here. Due to which i cannot get stable overall count.

component.ts file
getCount(id){
this.service.postGroupInfo(grpId).subscribe((res: any)=>{
const count = res.Count
return count
})
}
How can i do it???