udayvunnam / xng-breadcrumb

A lightweight, configurable and reactive breadcrumbs for Angular 2+
https://udayvunnam.github.io/xng-breadcrumb
MIT License
237 stars 62 forks source link

Hiding the breadcrumbs with one level only #169

Closed SamShekhovtsov closed 1 year ago

SamShekhovtsov commented 1 year ago

🧩 Feature request

Description

I would like to be able to disable showing breadcrump for one level, showing the breadcrump only if there are two or more nested levels.

for example, the following shouldn't appear:

Home

but the following should be shown:

Home -> Orders

and also this should be shown:

Home -> Orders -> Next Order

github-actions[bot] commented 1 year ago

Hello 👋 @SamShekhovtsov
Thank you for raising an issue. We will investigate into the issue and get back to you as soon as possible. Please make sure you have given us as much context as possible.
Feel free to raise a PR if you can fix the issue. Check the local development guide

udayvunnam commented 1 year ago

You can already do this.

  <xng-breadcrumb
    separator="→"
    class="your-class"
  >
    <ng-container
      *xngBreadcrumbItem="
        let breadcrumb;
        let info = info; // custom info defined for your breadcrumb
        let first = first; // boolean. Is the item first on the list 
        let count = count // count of total breadcrumbs
      "
    >
      <ng-container *ngIf="count > 1">{{ breadcrumb }}</ng-container>
    </ng-container>
  </xng-breadcrumb>
SamShekhovtsov commented 1 year ago

thanks for the suggestion, it works!