How do I set up services and controllers to communicate effectively?
<p>I am creating a search and filter application for rooms. The user is able to search for a room name (e.g. Conference Room 101) and also able to add filters to narrow down their search (e.g. capacity = 6). I am trying to figure out a good solution of how to setup my services and controllers and have come up with the following solution:</p>

<p><a href="https://i.stack.imgur.com/T3t6X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T3t6X.png" alt="Visio Diagram"></a></p>

<p>The filterService gets updated by the filterCtrl through the UI and broadcasts('run:search'). This then triggers the searchResultsCtrl to ask searchResultsService for updated searchResults. The same process happens when the user types into the search field (searchFieldCtrl is updated, then updates searchFieldService). </p>

<p>Once searchResultsService receives the request, it gets all the rooms from roomService, applies the filters using applyFilters inside filterService, then gets the searchField and filters out the remaining rooms. </p>

<p>Is this a good solution using broadcasts or is there a better solution that I am missing?</p>

<p>Edit: I've added a workflow diagram for the filters. The same workflow happens for searchField but updates searchFieldCtrl and searchFieldService.</p>

<p><a href="https://i.stack.imgur.com/B8Egn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B8Egn.png" alt="Workflow"></a></p>