brandonroberts / vladivostok-sample

1 stars 0 forks source link

CrisisCenter: why does it start with CrisisList? #14

Open wardbell opened 8 years ago

wardbell commented 8 years ago

This is what the app displays when it launches (no path) image

How does it know to display the first route component (CrisisList)? We don't have useAsDefault or indexRoute yet. Even reversing the order of the items in the app.routes.ts:RouterConfig doesn't change it.

wardbell commented 8 years ago

AHA!

Only later, when looking at the crisis-center.routes.ts did I see that both the CRISIS_CENTER route and its child to CrisisListComponent are marked with index: true which is the new useAsDefault.

  CRISIS_CENTER: {
    path: '/crisis-center',
    component: CrisisCenterComponent,
    index: true,
    children: [
      { path: '/', component: CrisisListComponent, index: true },
      { path: '/:id', component: CrisisDetailComponent, canDeactivate: [CanDeactivateCrisisDetail] }
    ]
  }

Leaving this issue open to remind us to document it.