question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Couldn't set label from component when [autoGenerate]="false"

See original GitHub issue

🐞 Bug report

Description

When I set a label with service for path chunk that was already autogenerated, it remains autogenerated and is filtered by [autoGenerate]=“false” property.

Service BreadcrumbService creates BreadcrumbDefinition with isAutoGeneratedLabel = true; It’s still autogenerated after we set label within a component.

I think we should reset isAutoGeneratedLabel if it is set by user in any time

here: https://github.com/udayvunnam/xng-breadcrumb/blob/212571fd2158fdd2baafd1b9d87e7e51f4488dd6/libs/xng-breadcrumb/src/lib/breadcrumb.service.ts#L336

🔬 Minimal Reproduction

  1. I’ve disabled “autoGenerate” option to manually control breadcrumb labels.

<xng-breadcrumb [autoGenerate]="false" [preserveFragment]="false"></xng-breadcrumb>

  1. My route config have not label for path chunk

{
  path: ':id',
  data: {
    breadcrumb: {
      alias: BreadcrumbAlias.wallet,
    } as BreadcrumbObject,
  },
  1. But I’ve set a label in the component:

ngOnInit(): void {
    this.breadcrumbService.set(`@${BreadcrumbAlias.account}`, { skip: false });
    this.breadcrumbService.set(`@${BreadcrumbAlias.wallet}`, this,wallet.title);
}

Result: My breadcrumb is filtered in BreadcrumbComponent. So it’s not visible for user

💻Your Environment

Angular Version:


Angular CLI: 11.2.2
Node: 14.16.1
OS: win32 x64

Angular: 11.2.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Ngx-breadcrumb Version

xng-breadcrumb: 6.6.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
udayvunnamcommented, Nov 15, 2021

@misterSerg this issue is fixed with xng-breadcrumb@6.8.2

1reaction
udayvunnamcommented, Jul 4, 2021

not stale

Read more comments on GitHub >

github_iconTop Results From Across the Web

App's localizations synthetic package autogeneration ...
If you add imports, this is generated, without imports, you get a false positive message in the logs, check the mentioned issue.
Read more >
storybook/addon-controls
Convenient. Auto-generate controls based on React/Vue/Angular/etc. components. Portable. Reuse your interactive stories in documentation, tests, ...
Read more >
How to deploy renamed the custom object tab using ...
I renamed a custom object tab name from 'ABC' to 'XYZ' in Customize > Tab Names and Labels > Edit . How can...
Read more >
Prevent Material-UI InputLabel from moving to the upper ...
I'm doing something similar and I'm using your method. It works with shrink={false} , the label doesn't move when I click on the...
Read more >
Object reference not set to an instance of an object. Error
Error message: Object reference not set to an instance of an object. Stack trace: at Telerik.Web.UI.RadComboBox.OnInit(EventArgs e). at System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found