title: Angular2 *ngIf is not working properly
body: <p>HTML</p>
  
  <pre><code>&lt;li class="nav-item"&gt;
    &lt;a class="nav-link" routerLink="/register" *ngIf="isLoggedIn"&gt;Register&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var auth = this.af.auth.subscribe( (user) =&gt; {
        if (user) {
          // User signed in!
          var uid = user;
          var isLoggedIn = true;
          console.log(uid)
          console.log(isLoggedIn);
        } else {
          // User logged out
          console.log("no user")
          var isLoggedIn = false;
          console.log(isLoggedIn);
        }
      });
  </code></pre>
  
  <p>The console is logging the true and false values correctly, so <code>var isLoggedIn</code> is correctly changing, but the *ngIf stays hidden no matter what.</p>