title: angular2 Router-outlet wont work after logged in
body: <p>When im logged in, and navigate to otherpage or login i get the following error:</p>
  
  <pre><code>EXCEPTION: Uncaught (in promise): Error: Cannot find primary outlet to load 'customComponent'
  Error: Cannot find primary outlet to load 'customComponent'
  </code></pre>
  
  <p>But when im not logged in,  navigating works.</p>
  
  <p>I also noticed that if i remove one of the router-outlets the navigation will work. Lets say i remove the router-outlet in loggedin, the navigation within user.username will work as normal.</p>
  
  <p>How come?
  How can i make it work as it should? if not logged in, show router outlet there, else if im online, show it somewhere else?</p>
  
  <p>Code:</p>
  
  <pre><code> &lt;div *ngIf="user.username"&gt;
     &lt;a routerLink="/murder" routerLinkActive="active"&gt;Murder&lt;/a&gt;
      &lt;a routerLink="/login" routerLinkActive="active"&gt;Login&lt;/a&gt;
  
      &lt;div&gt;
      &lt;router-outlet&gt;&lt;/router-outlet&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div *ngIf="loggedin == false"&gt;
     &lt;a routerLink="/murder" routerLinkActive="active"&gt;Murder&lt;/a&gt;
      &lt;a routerLink="/login" routerLinkActive="active"&gt;Login&lt;/a&gt;
  
  // other things
      &lt;div&gt;
      &lt;router-outlet&gt;&lt;/router-outlet&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Update:</p>
  
  <p>i made the router-outlet in login to:</p>
  
  <pre><code> &lt;router-outlet name="regular"&gt;&lt;/router-outlet&gt;
  </code></pre>
  
  <p>and outside:</p>
  
  <pre><code>        &lt;router-outlet name="aux"&gt;&lt;/router-outlet&gt;
  </code></pre>
  
  <p>and changed my routing:</p>
  
  <pre><code>   path: 'murder',
                component: MurderComponent,
                outlet: 'regular'
  </code></pre>
  
  <p>but when i navigate i get:</p>
  
  <pre><code>EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'murder'
  </code></pre>
  
  <p>how come?</p>
  
  <p>full code routing:</p>
  
  <pre><code> RouterModule.forRoot([
  
                {
                    path: 'login',
                    component: LoginhandlerComponent,
                    outlet: 'aux'
  
                },
  
            {
                path: 'murder',
                component: MurderComponent,
                outlet: 'regular'
  
            },
  
  
            ]
  
        )
  </code></pre>