title: Angular 2 - conditional header
body: <p>I have a header with a few buttons such as Home, About us, Register, Log in, Log out, Register and I want to show all except Log in and Register when user is logged in and only those two if user isn't logged.</p>
  
  <p>I know that I can use something like this:</p>
  
  <pre><code>&lt;li *ngIf="!isUserLoggedIn"&gt;&lt;a href="#"&gt;Log in&lt;/a&gt;&lt;/li&gt;
  &lt;li *ngIf="isUserLoggedIn"&gt;&lt;a href="#"&gt;Log out&lt;/a&gt;&lt;/li&gt;
  &lt;li *ngIf="!isUserLoggedIn"&gt;&lt;a href="#"&gt;Register&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>but it's probably a bad idea to call a service from a header to check whether user is logged and initialize this variable. Am I right ?</p>