1

This is how my module looks

const routes: Routes = [
  {
    path: 'home', component: HomeComponent,
    children: [
      { path: '', redirectTo: 'compact', pathMatch: 'full' },
      { path: 'compact', component: CompactComponent },
      { path: 'reports', component: ResearchReportsComponent },
    ]
  }
];

@NgModule({
  imports: [
    CommonModule
    RouterModule.forChild(routes)
  ],
  declarations: [
    HomeComponent
  ]
})
export class HomeModule {
}

I want to make redirectTo value depend on a variable from myservice.

Jota.Toledo
  • 27,293
  • 11
  • 59
  • 73
ishandutta2007
  • 16,676
  • 16
  • 93
  • 129
  • 1
    Possible duplicate of [Angular 2 dynamically change default route](https://stackoverflow.com/questions/42300144/angular-2-dynamically-change-default-route) – Jota.Toledo Dec 02 '17 at 12:10

0 Answers0