title: redirectTo lazy module based on user role
body: <p>In my angular 8 application, I have 3 lazy-loading modules. Each module is for a specific user's role. I'm using canActivate interface for Auth and Role Guard.<br>
  For the following route <br></p>
  
  <pre><code>{ path : '' , pathMatch : 'full' , redirectTo : ''}
  </code></pre>
  
  <p>how should I use <strong>redirectTo</strong> property, so it redirects to a lazyloaded route based on user role .
  This is the code for routing module. <br> <br>
  <strong>app.routing.module.ts</strong> <br></p>
  
  <pre><code>import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  
  const routes: Routes = [
    { path : '' , pathMatch: 'full' , redirectTo : ''},  
    { path : 'admin'  , loadChildren : () =&gt; import('./modules/admin/admin.module').then(mod =&gt; mod.AdminModule) , canActivate : [AuthGuardService] , data : { role : 'admin'}} ,
    { path : 'member' , loadChildren : () =&gt; import('./modules/member/member.module').then(mod =&gt; mod.MemberModule) , canActivate : [AuthGuardService] ,   data : { role : 'member'}} ,
    { path : 'user'   , loadChildren : () =&gt; import('./modules/user/user.module').then(mod =&gt; mod.UserModule) , canActivate : [AuthGuardService] , data : { role : 'user'}} ,
  
    { path : '**' , component : NotFoundComponent }
  ];
  @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  export class AppRoutingModule { }
  </code></pre>
  
  <p><strong>AuthGuardService.ts</strong> <br></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Router , CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
  import { Observable } from 'rxjs';
  import { AuthService } from '../auth-service/auth-service.service';
  
  @Injectable({
    providedIn: 'root'
  })
  export class AuthGuardService implements CanActivate {
    constructor(
        private router: Router,
        private authService: AuthService
    ) {}
  
    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) : Observable&lt;boolean&gt; | Promise&lt;boolean&gt; | boolean {
      const currentUser = this.authService.userVal;
      const role       = route.data.role;
      if (currentUser) {      
        if(role &amp;&amp; role.indexOf(currentUser.role) &gt; -1)
          return true;          
        else 
          return false;          
      }
      return false;
    }
  }
  </code></pre>