How to use a filter in a controller?
Asked 07 September, 2021
Viewed 2.3K times
  • 63
Votes

I have written a filter function which will return data based on the argument you are passing. I want the same functionality in my controller. Is it possible to reuse the filter function in a controller?

This is what I've tried so far:

function myCtrl($scope,filter1)
{ 
    // i simply used the filter function name, it is not working.
}

15 Answer