title: AngularJS: Correct place for global menu provider, service or rootScope?
body: <p>I'm new to AngularJS, and - since it is quite complex and the approach is new for me, I'm a bit confused. </p>
  
  <p>I'm from "classic" background (server-side template languages [like Yii, django, Smarty] + some jQuery to make things a bit dynamic).</p>
  
  <p>Let's say I have a menu bar (Bootstrap NavBar, or anything else)  - an element which lives <em>outside</em> of the main page <em>content</em>, like this:</p>
  
  <pre><code>&lt;body&gt;
    &lt;div id="menubar"&gt;
      ... &lt;!-- menu content --&gt;
    &lt;/div&gt;
    &lt;div class="container"&gt;
      &lt;div ng-view&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Now I'd like to make the menu a bit dynamic, i.e add or remove some menu items inside of the controller. 
  Using the server side frameworks &amp; their templating systems, for example Yii - I'd simply have a <code>BaseController</code> class with <code>$menuItems</code> variable, and render it each time in the <code>menuBar</code>, while all the controllers would inherit from <code>BaseController</code> so they could modify items.</p>
  
  <p>Also, I need a function which handles the <code>searchForm</code> located inside menu bar. Where should it live?</p>
  
  <p>What is Angular way for something like this? So far I've been thinking of creating custom <code>service</code> or extending <code>$rootScope</code>.</p>