Within my Angular view, I have declared a variable called data
with the following values:
[{"name":"science", count: 3},
{"name":"action", count: 1},
{"name":"thriller", count: 1},
{"name":"article", count: 1},
]
" I am attempting to extract the count value for the names "science" or "article" in an HTML file.
I have tried the following approach:
<span ng-repeat="item in data| filter: {name: "science"}">
{{ item.count }}
</span>
However, this does not return any results. I suspect it is due to the filter. How can I achieve this? Any assistance would be greatly appreciated.