title: AngularJS - Change navigation menu based on user logged
body: <p>I am using SpringBoot and Angular JS for my web application and I would like to know a good way to change the navigation menu based on the user logged.</p>
  
  <p>I was placing the navigation bar inside all the views but im sure there is a better way to do it.</p>
  
  <p>User.class</p>
  
  <pre><code>@Entity
  public class Usuario implements Serializable {
  @Enumerated(EnumType.STRING)
  private Rol rol; -&gt; This can be "UserA","UserB","UserC"
  }
  </code></pre>
  
  <p>And my different navigation menus are</p>
  
  <p>Navigation for UserA</p>
  
  <pre><code>&lt;nav id="nav"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#/userA1"&gt;A1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userA2"&gt;A2&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userA3"&gt;A3&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>Navigation for UserB</p>
  
  <pre><code>&lt;nav id="nav"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#/userB1"&gt;B1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userB2"&gt;B2&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userB3"&gt;B3&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>Navigation for UserC</p>
  
  <pre><code>&lt;nav id="nav"&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="#/userC1"&gt;C1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userC2"&gt;C2&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/userC3"&gt;C3&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>Thanks!</p>