title: Reload Angular 6 component after login
body: <p>I have a menu, which should be updated after the user has logged in. The menu is added in the app.component's html. </p>
  
  <p>The menu is generated with the use of the following code.</p>
  
  <pre><code>&lt;li *ngFor="let item of menuitems"&gt;
       &lt;a class="nav-link" [routerLink]="[item.url]" routerLinkActive="active" {{item.name}}&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>The menu items is changed after the user is logged in. I would like to force the page to reload (ideally just that component) when the user is logged in. When I do a manual refresh I get the new menu. </p>
  
  <p>The component is added to the main component. With the use of </p>
  
  <pre><code>&lt;app-menu&gt;&lt;/app-menu&gt;
  </code></pre>
  
  <p>The menuitems are defined like this;</p>
  
  <pre><code>async ngOnInit() {
       this.menuitems = await this.menus.getMenu();
  }
  </code></pre>
  
  <p>The menu service returns the elements if the user is logged in or not. </p>
  
  <p>I guess that I have to update the menu component after the login has been successful, but I do not know how this can be done.</p>