title: How to show/hide menu items in side menu in app.html? Ionic 2
body: <p>In my <code>app.component.ts</code> I define the pages that will go in my side menu.
  And in my <code>app.html</code> I have my <code>&lt;ion-menu&gt;</code> with all menu items. However, there are some that are activated when the user logs on.</p>
  
  <p>In my <code>app.component.ts</code> I get the user's token to know if I logged in (this is saved in the <code>localstorage</code> when the user logs in) and I save it in a variable and this I put it as conditional in my html using ngIf.</p>
  
  <p>But as the user navigates through the application and clicks to logout, the side menu is not refreshed by more than removing the user's token from the localstorage.</p>
  
  <p>This is my <strong>app.component.ts</strong>:</p>
  
  <pre><code>import { HomePage } from '../pages/home/home';
  import { LoginPage } from './../pages/login/login';
  import { OtherPage1 } from './../pages/others/other_one';
  import { OtherPage2 } from './../pages/others/other_two';
  
  export class MyApp {
    @ViewChild('content') menu : NavController;
    rootPage:any = HomePage;
    public userToken;
    login = LoginPage;
    home = HomePage;
    other_1 = OtherPage1;
    other_2 = OtherPage2;
  
    constructor(...) {
      platform.ready().then(() =&gt; {
        statusBar.styleDefault();
        splashScreen.hide();
      });
  
      this.userToken = localStorage.getItem('idTokenUser');
  
      [...]
    }
  
    goPage(page:any){
      this.menu.setRoot(pagina);
      this.menuCtrl.close();
    }
  
    logout(){
      localStorage.removeItem('idTokenUser')
      this.menu.setRoot(HomePage);
      this.menuCtrl.close();
    }
  
  }
  </code></pre>
  
  <p>This is my <strong>app.html</strong>:</p>
  
  <pre><code>&lt;ion-menu [content]="content" persistent="true"&gt;
      &lt;ion-header color="primary"&gt;&lt;/ion-header&gt;
      &lt;ion-content&gt;
          &lt;ion-list&gt;
              &lt;button ion-item (click)="goPage(home)"&gt;
              &lt;ion-icon item-start name="home"&gt;&lt;/ion-icon&gt;
              Home&lt;/button&gt;
  
              &lt;button ion-item *ngIf="userToken" (click)="goPage(other_1)"&gt;
               &lt;ion-icon item-start name="clipboard"&gt;&lt;/ion-icon&gt;
               Other 1&lt;/button&gt;
  
               &lt;button ion-item *ngIf="userToken" (click)="goPage(other_2)"&gt;
               &lt;ion-icon item-start name="people"&gt;&lt;/ion-icon&gt;
               Other 2&lt;/button&gt;
  
              &lt;button ion-item *ngIf="!userToken" (click)="goPage(login)"&gt;
              &lt;ion-icon item-start name="key"&gt;&lt;/ion-icon&gt;
              Login&lt;/button&gt;
  
              &lt;button ion-item *ngIf="userToken" (click)="logout()"&gt;
              &lt;ion-icon item-start name="close-circle"&gt;&lt;/ion-icon&gt;
              Logout&lt;/button&gt;
  
          &lt;/ion-list&gt;
      &lt;/ion-content&gt;
  &lt;/ion-menu&gt;
  
  &lt;ion-nav [root]="hom" #content&gt;&lt;/ion-nav&gt;
  </code></pre>
  
  <p>What is the way to remove item in side menu, when the user clicks to log out, at any time?</p>