{"id":17605568,"url":"https://github.com/ez-ng/breadcrumbs","last_synced_at":"2025-03-09T03:31:35.668Z","repository":{"id":189582769,"uuid":"680765079","full_name":"ez-ng/breadcrumbs","owner":"ez-ng","description":"An angular component that automatically lists breadcrumbs based on the currently routed components.","archived":false,"fork":false,"pushed_at":"2024-02-11T12:01:29.000Z","size":434,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T18:17:55.408Z","etag":null,"topics":["angular","angular16","breadcrumbs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ez-ng.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-20T10:31:37.000Z","updated_at":"2024-10-21T23:37:59.000Z","dependencies_parsed_at":"2024-10-23T06:26:36.978Z","dependency_job_id":null,"html_url":"https://github.com/ez-ng/breadcrumbs","commit_stats":null,"previous_names":["ez-angular/ez-breadcrumbs","ez-ng/breadcrumbs"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ez-ng%2Fbreadcrumbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ez-ng%2Fbreadcrumbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ez-ng%2Fbreadcrumbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ez-ng%2Fbreadcrumbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ez-ng","download_url":"https://codeload.github.com/ez-ng/breadcrumbs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242640885,"owners_count":20162051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular16","breadcrumbs"],"created_at":"2024-10-22T15:01:15.180Z","updated_at":"2025-03-09T03:31:35.320Z","avatar_url":"https://github.com/ez-ng.png","language":"TypeScript","readme":"# ez-breadcrumbs\n\nAn angular component that automatically lists breadcrumbs based on the currently routed components.\n\n## Usage\n\n\u003e **_TL;DR:_** Import `EzBreadcrumbsModule.forRoot()`, add `\u003cez-breadcrumbs/\u003e`, use `breadcrumb('Label')` or an injected `BreadcrumbRef`'s label property to set a routed component's breadcrumb.\n\nFirst, add the `EzBreadcrumbsModule` to your `AppModule`'s imports via the `forRoot` method:\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { EzBreadcrumbsModule } from 'ez-breadcrumbs';\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\n\n@NgModule({\n  declarations: [AppComponent],\n  imports: [BrowserModule, AppRoutingModule, EzBreadcrumbsModule.forRoot()],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {}\n```\n\n\u003e **_NOTE:_** Also import the `EzBreadcrumbsModule` in all applicable lazy loaded modules (without using `forRoot`).\n\nSecond, add the `EzBreadcrumbsComponent` to your template:\n\n```typescript\nimport { Component, inject } from '@angular/core';\nimport { BreadcrumbsService } from 'ez-breadcrumbs';\n\n@Component({\n  selector: 'app-root',\n  template: `\n    \u003cheader\u003e\n      \u003cez-breadcrumbs/\u003e\n    \u003c/header\u003e\n    \u003cmain\u003e\n      \u003crouter-outlet/\u003e\n    \u003c/main\u003e\n  `\n})\nexport class AppComponent { }\n```\nFinally, in your routed components use the `breadcrumb` function in the constructor to set the label of the component's breadcrumb. \n\n```typescript\nimport { Component } from '@angular/core';\nimport { breadcrumb } from 'ez-breadcrumbs';\n\n@Component({\n  selector: 'app-foo',\n  template: `\n    \u003cp\u003efoo works!\u003c/p\u003e\n  `\n})\nexport class FooComponent {\n  constructor() {\n    breadcrumb('Foo');\n  }\n}\n```\n\u003e **_NOTE:_** Breadcrumbs will only be shown if they have a label set. \n\nAlternatively, inject a `BreadcrumbRef` and use it to set the label. This way, the label can be updated at any time.\n\n```typescript\nimport { Component, inject } from '@angular/core';\nimport { BreadcrumbRef } from 'ez-breadcrumbs';\n\n@Component({\n  selector: 'app-foo',\n  template: `\n    \u003cp\u003efoo works!\u003c/p\u003e\n  `\n})\nexport class FooComponent {\n  private _breadcrumb = inject(BreadcrumbRef);\n\n  ngOnInit(): void {\n    this._breadcrumb.label = 'Foo'\n  }\n}\n```\n\n\u003e **_NOTE:_** Only components activated in primary outlets can have breadcrumbs.\n\n\u003e **_NOTE:_** The home breadcrumb's default label is `'Home'`. To customize (or translate) the label, see the I18n section below.\n\nIf the `EzBreadcrumbsComponent` doesn't fit your needs, you can create your own component and subscribe to the `breadcrumbs$` observable on the `EzBreadcrumbs` service to get a list of breadcrumbs to display. The observable also emits when the contents of any breadcrumb change.\n\n## I18n\n\nText strings used by the `EzBreadcrumbsComponent` are provided through `EzBreadcrumbsIntl`. Localization of these messages can be done by providing a subclass with translated values in your application root module.\n","funding_links":[],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fez-ng%2Fbreadcrumbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fez-ng%2Fbreadcrumbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fez-ng%2Fbreadcrumbs/lists"}