# ngx-neocrumb

> An Angular module for creating breadcrumbs based on Routes.

Latest version **0.1.6** (published 2019-10-19) · 0 weekly downloads

## Install

```sh
npm install ngx-neocrumb
pnpm add ngx-neocrumb
yarn add ngx-neocrumb
bun add ngx-neocrumb
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2019-10-19 |
| First published | 2019-09-28 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 165.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Moein459 |
| Maintainers | moein459 |
| Keywords | breadcrumb, angular breadcrumb, angular, breadcrumb, boostrap breadcrumb, material breadcrumb, ngx-neocrumb, ng-neocrumb, ngx-breadcrumbs, ng-breadcrumbs, angular crumbs |

## Links

- npm: https://www.npmjs.com/package/ngx-neocrumb
- Repository: https://github.com/moein459/ngx-neocrumb
- Issues: https://github.com/moein459/ngx-neocrumb/issues
- npm.io page: https://npm.io/package/ngx-neocrumb

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 0.1.6 (latest) — 2019-10-19
- 0.1.5 — 2019-10-02
- 0.1.4 — 2019-10-02
- 0.1.3 — 2019-10-02
- 0.1.2 — 2019-09-30
- 0.1.1 — 2019-09-30
- 0.1.0 — 2019-09-30
- 0.0.9 — 2019-09-30
- 0.0.8 — 2019-09-30
- 0.0.7 — 2019-09-30
- 0.0.6 — 2019-09-30
- 0.0.5 — 2019-09-30
- 0.0.4 — 2019-09-28
- 0.0.3 — 2019-09-28
- 0.0.2 — 2019-09-28
- … 1 more at https://npm.io/package/ngx-neocrumb/versions

## README

# NGX-NeoCrumb

An Angular module for creating breadcrumbs based on Routes.

[Demo](https://angular-jmthr4.stackblitz.io)

[StackBlitz Example](https://stackblitz.com/edit/angular-jmthr4)

## Installation
```bash
$ npm install ngx-neocrumb
```

The only thing you need to do is import `NeoCrumbModule` in your `app / shared` module.

```javascript
import { NeoCrumbModule } from 'ngx-neocrumb';
@NgModule({
  imports: [
    NeoCrumbModule,
  ],  
})
export class AppModule {}
```

And then import one of the styles in `styles.scss`
```scss
@import "~ngx-neocrumb/lib/styles/neo-crumb-bs4.css";
```
```scss
@import "~ngx-neocrumb/lib/styles/neo-crumb-mat.css";
```
```scss
@import "~ngx-neocrumb/lib/styles/neo-crumb-min.css";
```

## Usage
Then you can use breadcrumb component in your template wherever you want it.
```javascript
@Component({
  selector: 'app-root',
  template: `
    <div class="container">
      <nc-neo-crumb [inlineBlock]="true"></nc-neo-crumb>
      <router-outlet></router-outlet>
    </div>`
})
export class AppComponent {}
```

## Configuration

Configuration of the breadcrumbs module is accessable in your route configuration.

```javascript
const routes: Route[] = {
  {
    path: '',
    component: DashboardComponent,
    data: {
      breadcrumb: {
        text: 'Dashboard',

        // Unnecessary fields: 
        iconClass: 'mdi mdi-view-dashboard',
        hide: false
      }
    }
  }
};
```
Also for changing values at runtime based on app logic, you can use NeoCrumbService to get current items and PostProcess them.
```javascript
constructor(private neoCrumbService: NeoCrumbService) {
    this.neoCrumbService.onChange.subscribe(value => {
        value.forEach(nc => {
            if (nc.text == 'Dash')
                nc.text = 'Dashboard';
        });
    });
    
    // this.neoCrumbService.postProcess([]);
}
```

---
_Source: https://npm.io/package/ngx-neocrumb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
