There is a controller of the header in which the search is located, and there is a controller of articles. Prompt the solution for organizing filtering from the search input.

Option with ng-model on the input and | filter: | filter: in ng-repeat does not work. thank

  • option with ng-model on input and | filter: ng-repeat works quite well for itself. Add an example of your code so that you can more accurately tell how to remake it - Grundy

1 answer 1

When I did something similar, when changing the search form in the header, I added a parameter to the URL ?search=[строка поиска]

In the controller of articles I checked the value of the search parameter at the first load and subscribed to the changes.

 $rootScope.$on( "$locationChangeSuccess", function(event, next, current) { // get articles }) 

Thus, you will have a direct link to the search query, it can be convenient.