1.0.3 • Published 6 years ago

ng-custom-breadcrumb v1.0.3

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

ng-custom-breadcrumb

Installation

In order to use library, you can import library in any Angular application by running:

$ npm install ng-custom-breadcrumb

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import the library
import { BreadcrumbModule } from 'ng-custom-breadcrumb';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Specify your library as an import
    BreadcrumbModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported, you can use it in your Angular application:

<!-- You can now use the library component in app.component.html -->
<breadcrumb-component [breadcrumbModel]="breadcrumbModel"></breadcrumb-component>

You can define breadcrumbModel in your .ts file like below:

breadcrumbModel = {
    model: [
      { label: 'Categories', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Sports', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Football', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Countries', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Spain' },
      { label: 'F.C. Barcelona', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Squad', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' },
      { label: 'Lionel Messi', url: 'https://en.wikipedia.org/wiki/Lionel_Messi' }
    ],
    style: { fontSize: "17px", bgColor: "#535377", passiveTextColor: "rgb(184, 194, 230)", activeTextColor: "white", fontFamily: "monospace" }
  };
PropertyDefaultDetails
modelnullmodel is an array of labels in breadcrumb.
labelnulllabel is label for breadcrumb.
stylenullto create a new design, you can set style property.
fontSizenullto change the label's font size in breadcrumb. Same as css "font-size" property.
bgColornullto change breadcrumb's background color. Same as css "background-color" property.
passiveTextColornullto change last label's (current page label) text color in the breadcrumb. Same as css "color" property.
activeTextColornullto change all label's text color except last one (all previous page links) in the breadcrumb. Same as css "color" property.
fontFamilynullto change font family of labels. Same ass css "font-family" property.

Sample Designs