title: Angular Routing views for different users
body: <p>I'm trying to set up the routing in my Angular 4 app for 3 types of users. </p>
  
  <p>Once a user is logged in he will be redirected to my app-component. This is what my <em>app-component.html</em> looks like: </p>
  
  <pre><code>&lt;div class="main-container"&gt;
    &lt;div class="wrapper"&gt;
      &lt;router-outlet&gt;&lt;/router-outlet&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to check what the type of the user is and according to that - open a different route in my router-outlet. To give you an idea I will show you the structure that I'm going for: </p>
  
  <pre><code>index.html
  &gt;app-component
  &gt;register-component
  &gt;login-component
  &gt;dentist-view
    schedule component
    patients component
    profile component
    appointments component  etc..
  &gt;admin-view
    manage users component
  &gt;patient-view
    ambulatory-lists component
    profile component
    dentist search component
    book appointment component etc..
  </code></pre>
  
  <p>So according to the user type I want to load completely different views, that are structured like so in my project. I want different navigation bars for each user, different edit profile components etc.. What is the right approach to achieve this, as once logged in I will receive the user type on redirect to the app-component, so I will be able to send it to it's children - dentist-view-component, patient-view-component etc.. </p>
  
  <p>To give you a better idea something like an alternative to this, but with routing would be great: (disclaimer: i know that this is not possible :D)
  in <em>app.component.html</em>:</p>
  
  <pre><code>&lt;div class="main-container"&gt;
    &lt;div class="wrapper"&gt;
      &lt;router-outlet&gt;
       &lt;dentist-component *ngIf="isDentist()"&gt;&lt;/dentist-component&gt;
       &lt;patient-component *ngIf="isPatient()"&gt;&lt;/patient-component&gt;
       &lt;admin-component *ngIf="isAdmin()"&gt;&lt;/admin-component&gt;
     &lt;/router-outlet&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As I'm new to this and still figuring things out I want to know if I'm headed the right direction or going a completely wrong way. Any advice is well appreciated. </p>