npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng7-mat-breadcrumb

v8.0.0

Published

Angular 14 Material Breadcrumb NPM Module

Downloads

358

Readme

ng7-mat-breadcrumb

ng7-mat-breadcrumb is a Angular Material module for Angular that generates a Angular Material breadcrumb for any page of your application. It is based on the built-in Angular router.

Demo Example

Demo Source Example

Usage

Getting started

1.Install ng7-mat-breadcrumb via npm:

npm install --save ng7-mat-breadcrumb

Choose the version corresponding to your Angular version:

Angular | ng7-mat-breadcrumb ----------- | ------------------- 14 | 8.x+
12 | 6.x+
11 | 5.x+
10 | 4.x+
9 | 3.x+
8 | 2.x+
7 | 1.x

2.Import the Ng7MatBreadcrumbModule within your app:

import {Ng7MatBreadcrumbModule} from "ng7-mat-breadcrumb";

@NgModule({
  imports: [
    Ng7MatBreadcrumbModule,
  ],
})

3.Add a name to your route by adding a breadcrumb property in the route's data:

const routes: Routes = [
  {
    path: 'page1/:pageOneID',
    component: PageComponent,
    data: {
      title: 'page1',
      breadcrumb: [
        {
          label: 'Page1',
          url: ''
        }
      ]
    },
  },
  {
    path: 'page1/:pageOneID/page2/:pageTwoID',
    component: Page2Component,
    data: {
      title: 'page2', 
      breadcrumb: [
        {
          label: 'page {{pageOneID}}',// pageOneID Parameter value will be add 
          url: '/page1/:pageOneID'
        },
        {
          label: 'page {{pageTwoID}}',// pageTwoID Parameter value will be add 
          url: ''
        }
      ]
    },
  },
  {
    path: 'page1/:pageOneID/page2/:pageTwoID/page3/:pageThreeID',
    component: Page3Component,
    data: {
      title: 'page3',
      breadcrumb: [
        {
          label: 'page1',
          url: '/page1/:pageOneID'
        },
        {
          label: '{{dynamicText}} page', // If "dynamicText" is not parameter , should be set value  using Ng7MatBreadcrumbService, More info please check the 5th point.
          url: 'page1/:pageOneID/page2/:pageTwoID'
        },
        {
          label: '{{customText}}', // If "customText" is not parameter , should be set value  using Ng7MatBreadcrumbService, More info please check the 5th point.
          url: ''
        }
      ]
    },
  },
];

4.Put the Ng7DynamicBreadcrumbComponent's selector within your template:

<app-ng7-mat-breadcrumb></app-ng7-mat-breadcrumb>
<router-outlet></router-outlet>

Input parameters

| Input | Required | Details | | ---- | ---- | ---- | | bgColor | Optional | To set background-color for Breadcrumb, default #eee | | fontSize | Optional | To set size of Breadcrumb, default 18px | | fontColor | Optional | To set color of Breadcrumb, default #0275d8 | | lastLinkColor | Optional | To set color of last link Breadcrumb, default #000 | | symbol | Optional | To set symbol of Breadcrumb, default / |

5.Set the value using Ng7MatBreadcrumbService

import { Ng7MatBreadcrumbService } from 'ng7-mat-breadcrumb';
constructor(private ng7MatBreadcrumbService: Ng7MatBreadcrumbService) { }
ngOnInit() {
  const breadcrumb =  {customText: 'This is Custom Text', dynamicText: 'Level 2 '};
  this.ng7MatBreadcrumbService.updateBreadcrumbLabels(breadcrumb);
  }
  1. Update the Breadcrumb using Ng7MatBreadcrumbService
import { Ng7MatBreadcrumbService } from 'ng7-mat-breadcrumb';
constructor(private ng7MatBreadcrumbService: Ng7MatBreadcrumbService) { }

  updateBreadcrumb(): void {
    const breadcrumbs  =  [
      {
        label: 'page {{pageOneID}}',
        url: '/page1/:pageOneID'
      },
      {
        label: 'page {{pageTwoID}}',
        url: 'page1/:pageOneID/page2/:pageTwoID'
      },
      {
        label: 'page {{pageThreeID}}',
        url: 'page1/:pageOneID/page2/:pageTwoID/page3/:pageThreeID'
      },
      {
        label: 'Update Breadcrumb',
        url: ''
      }
    ];
    this.ng7MatBreadcrumbService.updateBreadcrumb(breadcrumbs);
  }

Questions & Issues

Report bugs/problems by creating an issue creating an issue

Contribute

Pick one of the issues from the issue list to get started.

Developer

Developer: Raja Rama Mohan Thavalam

| Raja Rama Mohan Thavalam | | ----------------- | | Raja Rama Mohan Thavalam |

License

(The MIT License)

Copyright (c) 2022 Thavalam Raja Rama Mohan