import { RouterConfig } from '@angular/router';

import { CustomerComponent }   from './customer.component';
import { CustomerOrdersComponent } from './customerOrders.component';
import { CustomerDetailsComponent } from './customerDetails.component';
import { CustomerEditComponent } from './customerEdit.component';

export const CustomerRoutes: RouterConfig = [
  { 
    path: 'customers/:id', 
    component: CustomerComponent,
    children: [
      { path:'orders',  component: CustomerOrdersComponent },
      { path:'details', component: CustomerDetailsComponent },
      { path:'edit', component: CustomerEditComponent }
    ]
  }
];


import { RouterConfig } from '@angular/router';

import { CustomerComponent }   from './customer.component';
import { CustomerOrdersComponent } from './customerOrders.component';
import { CustomerDetailsComponent } from './customerDetails.component';
import { CustomerEditComponent } from './customerEdit.component';

export const CustomerRoutes: RouterConfig = [
  { path: 'customers/:id', terminal: true, redirectTo: '/customers/:id/details' }, //route path with only a customer id to the details route.
  { 
    path: 'customers/:id', 
    component: CustomerComponent,
    children: [
      { path:'orders',  component: CustomerOrdersComponent },
      { path:'details', component: CustomerDetailsComponent },
      { path:'edit', component: CustomerEditComponent }
    ]
  }
];


Add redirect from path to .../id to .../id/details
Add redirect from path to .../id to .../id/details

Routes to customer id only will now redirect to customer details page.