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

ng-qbreadcrumb

v1.0.17

Published

a breadcrumb component for angular

Downloads

19

Readme

ng2-qbreadcrumb

npm version

ng2-qbreadrumb is a component for Angular

Demo

Install

You can get it on npm.

npm install ng-qbreadcrumb --save   vc 

Setup

You'll need to add BreadCrumbModule to your application module.

import { BreadcrumbsModule } from 'ng-qbreadcrumb';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BreadCrumbModule,
    ...
  ],
  providers: [],
  bootstrap: [AppComponent]
})

export class AppModule {
}
@Component({
  selector: 'sample',
  template:`
  <div>
    <app-breadcrumb [options]="breadCrumbOptions" #breadCrumb [ids]="ids" (rootClickEvent)="rootClickEvent($event)" (breadNodeClickEvent)="clickBreadcrumb($event)"></app-breadcrumb>
  </div>
  `
})
class Sample {}

Usage

import { Options as breadcrumbOption }  from 'ng-qbreadcrumb';

@Component({
  selector: 'sample',
  template:`
  <div>
    <app-breadcrumb [options]="breadCrumbOptions" #breadCrumb [ids]="ids" (rootClickEvent)="rootClickEvent($event)" (breadNodeClickEvent)="clickBreadcrumb($event)"></app-breadcrumb>
  </div>
  `
})
class Sample {
   breadCrumbOptions : breadcrumbOption = {
    keyId : 'r_object_id',    //property id for each breadcrumb node
    requestId : 'ids',        //request params id for backend api
    keyTitle : 'object_name', //which property to show of your data
    url:'api/breadcrumbs',    //request url
    additionalParam : {        
      customParams : 'helloWorld' //additional parameter to request,usage for user info
    },
    requestCallBack : res => res.data //do something after get response,should return the breadcrumb data,default is : res => res 
  }  
}

Directive

<app-breadcrumb [options]="breadCrumbOptions" #breadCrumb [ids]="ids" (rootClickEvent)="rootClickEvent($event)" (breadNodeClickEvent)="clickBreadcrumb($event)"></app-breadcrumb>

Input

| Property Name | Type | Description | | :-------------: |:-------------:| -----| | ids | Array | the breadcrumb component will watch ids's change and update data or send request | | options | Options | set your own breadcrumb option |

###Options

{  
    keyId : string;             //节点的objectId字段
    url : string;               //http请求的接口地址
    requestId? : string;        //请求的id对应的参数名
    keyTitle? : string;         //面包屑上显示的字段属性名
    method? : 'get' | 'post';       //请求的方法
    additionalParam? : any;  //额外需要添加的请求参数
    requestCallBack?(res : any) : any; //接口返回后的数据处理
}

Output

| Property Name | Type | Description | | :-------------: |:-------------:| -----| | rootClickEvent | Function | call this Function when user click root event,usage for when you set root node | | breadNodeClickEvent | Function | call this Function when user click breadcrumb node |

BreadcrumbService

This service exposes a few different methods with which you can interact with ng-qbreadcrumb.

BreadcrumbService.hideRoute(name: string)

hide a node which you do not want to show

BreadcrumbService.isRouteHidden(name: string)

check the node is hide or not

BreadcrumbService.setRootNode(name: Array<string> | string)

set root node/nodes for breadcrumb,can be the string for single root or Array

BreadcrumbService.getRootNodes()

get root of the breadcrumb