0

Let's say you have this ng-repeat with some filters

ng-repeat="city in cities" | filter={region:region} | filter=searchQuery etc..

I'd to run some logic on all cities that is filtred. For example summarize the population in all filtred cities. Is there any easy way to do this? Just get a list to the controller on all items that is filtred in the list?

Joe
  • 4,274
  • 32
  • 95
  • 175

1 Answers1

0

You can actually inject the $filter service in a controller and use it there.

Related thread, so not going to copy paste his answer: How to use a filter in a controller?

Community
  • 1
  • 1
Busata
  • 1,088
  • 1
  • 10
  • 24