rajaramtt / ng7-dynamic-breadcrumb

Angular 10 Dynamic Breadcrumbs
MIT License
42 stars 31 forks source link

Breadcrumb contents missing after refresh #13

Closed krazy-hotdog closed 3 years ago

krazy-hotdog commented 4 years ago

Hi,

It's my first time to use this module and I'm also new to Angular. It's working fine it's just that, when I refresh the page all the routes displayed in the breadcrumb disappears. What's left is just a blank component. This also happens when i first navigate to the first level, it will only shows the breadcrumbs content when I route to the second level and go back to the first level.

Thanks.

krazy-hotdog commented 4 years ago

By the way i am using it as children in routing module

rajaramtt commented 4 years ago

@krazy-hotdog If possible please provide reproducible stackblitz demo link.

krazy-hotdog commented 4 years ago

Hi, I just added a new component (HeyComponent) in your sample and make it the parent. Instead of putting the "app-ng-dynamic-breadcrumb element" in my app.component.html, I put it in my hey.component.html.

Here is my app-routing.module.ts

#######################################

const routes: Routes = [ {path : 'hey', component : HeyComponent, children : [

  {
    path: 'page1/:pageOneID',
    component: PageComponent,
    data: {
      title: 'page1',
      breadcrumb: [
        {
          label: 'Page1',
          url: '',
        }
      ]
    },
  },
  {
    path: 'page1/:pageOneID/page2/:pageTwoID',
    component: Page2Component,
    data: {
      title: 'page2',
      breadcrumb: [
        {
          label: 'page1',
          url: 'page1/:pageOneID'
        },
        {
          label: 'page2',
          url: ''
        }
      ]
    },
  },
  {
    path: 'page1/:pageOneID/page2/:pageTwoID/page3/:pageThreeID',
    component: Page3Component,
    data: {
      title: 'page3',
      breadcrumb: [
        {
          label: 'page {{pageOneID}}',
          url: 'page1/:pageOneID'
        },
        {
          label: 'page {{pageTwoID}}',
          url: 'page1/:pageOneID/page2/:pageTwoID'
        },
        {
          label: 'page {{customText}}',
          url: ''
        }
      ]
    },
  },
  {
    path: '', pathMatch: 'full', redirectTo: '/hey/page1/1'
  }

]

}

]

siddhartha-gupta commented 4 years ago

+1, I'm also facing the same issue. Breadcrumbs are missing once I refresh the app.

marcosybarraa commented 4 years ago

Same here for Angular universal SSR NG8 version

b4p3p commented 4 years ago

+1

gauravmasand09 commented 1 year ago

is this resolved ?