I have two component one is lead board and other is lead card i am using drag and drop of angular material to generate board and i have generated board list using below code and i generate card of darg and drop using ngFor="let lead of leadGroup.group" i want to conver LeadStatusTitle in object so that i can display it on html page . I am not getting data for LeadStatusTitle
lead-board-Component.html
<div cdkDropListGroup>
<div class="drag-container" *ngFor="let leadGroup of leadKeyValue$ | async">
<h4>{{ leadGroup.LeadStatusTitle }}</h4>
<div
cdkDropList
[cdkDropListData]="leadGroup.group"
class="item-list"
(cdkDropListDropped)="drop($event)"
>
<div class="item-box" *ngFor="let lead of leadGroup.group" cdkDrag>
<app-lead-card lead></app-lead-card>
</div>
</div>
</div>
</div>
lead-card.Component.html
<div>{{ lead.Company }}</div>
lead-board.Component.ts
leadKeyValue$: Observable<
{
LeadStatusTitle: string;
group: string[];
}[]
>;
ngOnInit(): void {
this.leads$ = this.store.select(getLeads);
// this.store.dispatch(LeadActions.loadLeads());
this.leads$.subscribe((x) => {
this.leadKeyValue$ = from(x).pipe(
groupBy((lead) => lead.LeadStatus),
mergeMap((obs) => {
console.log(obs);
return obs.pipe(
map((x) => JSON.stringify(x)),
toArray(),
map((items) => {
return {
LeadStatusTitle: obs.key,
group: items,
};
})
);
}),
toArray()
);
});
}
When i binding {{ lead.Company }} in lead-card.Component.ts i am getting error TS2339: Property 'Company' does not exist on type 'string'. Thank you
FirstNameexactly, please?