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
🔬 Minimal Reproduction
- I’ve disabled “autoGenerate” option to manually control breadcrumb labels.
<xng-breadcrumb [autoGenerate]="false" [preserveFragment]="false"></xng-breadcrumb>
- My route config have not label for path chunk
{
path: ':id',
data: {
breadcrumb: {
alias: BreadcrumbAlias.wallet,
} as BreadcrumbObject,
},
- 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:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@misterSerg this issue is fixed with
xng-breadcrumb@6.8.2
not stale