Data and directives (structure) <p>Following your about large Angularjs app structure I'm using this styleguide:</p> <p><a href="https://github.com/johnpapa/angular-styleguide" rel="nofollow">https://github.com/johnpapa/angular-styleguide</a></p> <p>I developed an <strong>itemManager</strong> (item-manager controller) which has two nested directives (<strong>search-options</strong> and <strong>search-results</strong>).</p> <ul> <li><p>Item Manager</p> <ul> <li><p>Search Options (not important for now)</p></li> <li><p>Search Result</p></li> </ul></li> </ul> <p>The item manager template will show the search options and the search results (using an iterator).</p> <p>The search-result directive controller has all the info needed to show an item.</p> <p>My problem is that I don't exactly know where to store the information of the array of items I'll show.</p> <p>The search options will trigger an AJAX call to a REST service that will return a JSON containing the info of all the search results I want to show. The problem is that I don't know where I should store the array containing the items info.</p> <p>I think that the markup on the item manager should be something like:</p> <pre><code>&lt;search-result ng-repeat="//iterator"&gt;&lt;search-result&gt; </code></pre> <p>but in the Item Manager I don't have access to the search-result variables (they are within the search-result directive scope).</p> <p>Then, if I store the variable inside the search-result directive I should iterate inside the directive template, which I don't think is right. Anyone can give me advice on how this should be structured?</p>