peterbsmyth / ngx-breadcrumbs

Angular 4+ routing breadcrumbs
MIT License
60 stars 43 forks source link

Home link not displaying as default in front of breadcrumbs #11

Open vcarrin1 opened 6 years ago

vcarrin1 commented 6 years ago

Hi,

I implemented the breadcrumbs in my application, everything is working as expected except I cannot get the Home link to display as default in front of each set of breadcrumbs.

Expected Result Home / Physical Objects / Details

Actual Result Physical Objects / Details

Router Config looks like this.

Home Route

export const HOME_ROUTE: Route = { path: '', component: HomeComponent, data: { pageTitle: 'dx Portal', breadcrumbs: 'Home' }, };

Physical Objects Route

export const physicalObjectRoute: Routes = [ { path: 'physical-object', data: { pageTitle: 'Physical Objects', breadcrumbs: 'Physical Objects' }, children: [ { path: '', component: PhysicalObjectComponent, }, { path: ':id', component: PhysicalObjectDetailComponent, data: { pageTitle: 'Physical Objects', breadcrumbs: 'Details' }, } ] } ];

RouterModule.forChild(physicalObjectRoute)

app.routing.module

const LAYOUT_ROUTES = [ HOME_ROUTE, ];

@NgModule({ imports: [ RouterModule.forRoot(LAYOUT_ROUTES, { useHash: true }) ], exports: [ RouterModule ] }) export class DxPortalAppRoutingModule {}

pwarelis commented 6 years ago

The process is described in the last section of the documentation. Look under API / postProcess