Need assistance with code for an Angular app that uses ngFor to populate a datatable. The goal is to count the number of columns with the name "apple" and display the total on a card named 'apples'.
I attempted to create a function like this:
let apples = [];
getValues(item){
item.apples.forEach(element => {
this.apples.push(element);
this.apples.length;
});
Then I tried to display the length value.
The desired outcome is to have each card show the count of columns with specific fruit names, for example: apples: 8, peach: 3, etc.