Assuming I have the following array "myarr":
[
{'name':'Mary', 'chapter':'Chapter 1'},
{'name':'Joseph', 'chapter':'Chapter 1'},
{'name':'John', 'chapter':'Chapter 2'},
{'name':'Carl', 'chapter':'Chapter 3'},
{'name':'Jacob', 'chapter':'Chapter 3'}
]
I want to count the number of objects in this array that have "Chapter 1" in the title. Is there any way to do this within the HTML template in angular?
Right now I call a function from the template like this:
{{countNumOf('Chapter 1')}}
{{countNumOf('Chapter 2')}}
with the function handling the count in the .ts... is there a smarter way to do this so I don't have to write an extra function in the .ts?