Answer the question
In order to leave comments, you need to log in
How to show badge in ngFor loop by condition?
In general, I got confused in simple things ... There are two arrays:
1) persons with objects of type
{
name: "Brown",
personId: "dsfrauAUHjfrkf32"
}
{
personId: "dsfrauAUHjfrkf32",
badge: true
Answer the question
In order to leave comments, you need to log in
1) Bake it into a separate array with a new type that contains data from both collections
2) make an accessor on your hasBadge(personId: string) type component and pull it inside ngFor passing the id of the current element
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question