-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue of updating labels dynamically #117
Comments
Hello 👋 @TomislavMedved |
Hey @TomislavMedved, this is a nice feature to have to improve the UX of the app. This is achievable. I will work on the API to achieve such behaviour. what would you expect in case item details service fails to provide a label on error. |
@TomislavMedved you can do this with existing breadcrumb APIs // skip item details breadcrumb in routing module declaration
{
path: 'itemDetailsPath',
component: ItemDetailsComponent,
data: { breadcrumb: { skip: true, alias: 'itemDeatils' } }
}
// set breadcrumbs just after getting data from the component
this.breadcrumbService.set('@itemDeatils', {skip: true});
this.itemService.getItemDetails(itemId).subscribe((response) => {
this.item = response;
this.breadcrumbService.set('@itemDeatils', {label: this.item.name, skip: false});
}); |
Yeah, but there's another issue with that approach, if you have a parent route which contains multiple children routes, and i update parent route with lets say List Name via alias and skip false, it will be shown initially on the first child route, but if i switch to another child route, list name that was updated dynamically is hidden again, it didn't remember newly skip false value but took initial skip true from the initial config from route.ts Example: Here in the example where we are directed to :cid/show/items initially. Parent :cid/show has breacrumbs skip true with boxName alias. Skip is true so we avoid issue of seeing old boxName for a breif second untill we get data for new box from the BE. If we dont use skip and use it normaly, it works, but then we have an issue of seeing old boxName for a time while new one is fetched. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am trying to find a solution for the same issue. On the initial page load is has the of the object for me and then I set the alias and it'll flicker. I'd rather the entire item not show up until the aliases are set |
My solution was to simply not show the breadcrumbs during navigation. In the component containing the breadcrumbs I simply added the following:
So, now the breadcrumbs won't be displayed until after the navigation has ended and it seems to no longer display the wrong name briefly. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a classic situation where i have List of items on one route/page. When i click on a single item within a list, i am redirected to details page/route of that item. There i update label dynamically to show name of the item.
My issue is that each time you navigate from item list to item details you have 0.5 sec (some amount of time before you get data from backend) preview of the recent item name untill i set the new one. This happens every time except the first time (because we didnt dynamically update anything yet).
I update label dynamically by alias.
Is there any way to avoid showing recent label which was dynamically updated?
I have solved it by skipping that path also and then when upading via alias setting skip to false, but i feel that that is more like a hack then a proper solution.
The text was updated successfully, but these errors were encountered: