Breadcrumb observable not working (setItems)

Post Reply
koleshy
Posts: 2
Joined: 23 May 2021, 07:03

05 Sep 2021, 23:48

Hello guys, the Breadcrumb observable is not working, I can't find the problem.
I follow the examples and did the same but the handler is not detecting setItems
on my new custom page component i already did:

constructor(private breadcrumbService: AppBreadcrumbService) {
this.breadcrumbService.setItems([
{ label: 'Operaciones' },
{ label: 'Emitir Factura', routerLink: [`/custom`] }
]);
}

on the app.breadcrumb.component.ts the subscribe is not working, the items is never set:

this.subscription = this.breadcrumbService.itemsHandler.subscribe(response => {
this.items = response;
console.log('breadcrumb.items', this.items); //never show
});

on the app.main.component.html is already:

<div class="layout-main">
<app-breadcrumb></app-breadcrumb>

<div class="layout-content">
<router-outlet></router-outlet>
</div>

<app-footer></app-footer>
</div>

merve7
Posts: 854
Joined: 12 Sep 2017, 10:44

08 Sep 2021, 14:06

Hi,

Could you check your app.breadcrumb.service.ts file and providers part in your app.module.ts file? Also, do you have any error or warning messages?

Best regards,
Merve Özçifçi

koleshy
Posts: 2
Joined: 23 May 2021, 07:03

08 Sep 2021, 17:34

Hello my friend, there is no error in the console my pages components works fine

I use a custom PrimeNg module to group PrimeNg components/services

Image

I import this custom PrimeNg module on my App module

Image

app.main.component.html
Image

app.breadcrumb.component.html
Image

app.breadcrumb.component.ts
Image

app.breadcrumb.service.ts
Image

app-routing.module.ts
Image

Post Reply

Return to “Poseidon - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests