title: Ionic 3 refresh side menu after login
body: <p>I need to display side menu items according to the role of the user. so I check in app.html if the page (role) is equal to logged in role. But it does not display items inside menu just after login but after refreshing the app using browser refresh button it displays correct items as it should. 
  I guess the problem is ionic is caching the menu view if it is so how can I refresh the app for new menu items to display.</p>
  
  <p>Every time I login with another user/role, it displays menu according to the previous user/role. </p>
  
  <p><strong>app.component.ts</strong></p>
  
  <pre><code>constructor() {
      this.initializeApp();
      this.pages = [
                      { title: 'Home', component: 'HomePage', icon: 'home', role: 5 },
                      { title: 'Profile', component: 'ProfilePage', icon: 'person', role: 5 },
                      { title: 'Account', component: 'AccountPage', icon: 'home', role: 5 },
                      { title: 'Search Employee', component: 'AtlasemployeehomePage', icon: 'home', role: 4 }
                   ];
  
    }
  </code></pre>
  
  <p><strong>app.html</strong></p>
  
  <pre><code>&lt;ion-list&gt;
        &lt;div *ngFor="let p of pages"&gt;
          &lt;button menuClose ion-item *ngIf="p.role == role"  (click)="openPage(p)"&gt;
            &lt;ion-icon  name="{{p.icon}}" style="margin-right:10%"&gt;&lt;/ion-icon&gt; {{p.title}}
          &lt;/button&gt;
        &lt;/div&gt;
  
        &lt;button menuClose ion-item (click)="presentLogout()"&gt;
          &lt;ion-icon name="log-out" style="margin-right:10%"&gt;&lt;/ion-icon&gt; Logout
        &lt;/button&gt; 
      &lt;/ion-list&gt;
  </code></pre>
  
  <p>I am setting the role variable according to the logged in user. </p>