Skip to content
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

Using Angular resolver in breadcrumb as a function #85

Closed
fgoulet opened this issue Jun 12, 2021 · 14 comments
Closed

Using Angular resolver in breadcrumb as a function #85

fgoulet opened this issue Jun 12, 2021 · 14 comments
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity

Comments

@fgoulet
Copy link

fgoulet commented Jun 12, 2021

🧩 Feature request

Description

I would like to be able to construct a breadcrumb item using data retrieved with an Angular resolver.
Maybe by leveraging breadcrumb as a function ?

{
  path: '/orders',
  children: [{
    ':id',
    resolve: {
          resolvedOrder: 'orderResolver'
     },
    data: {
      breadcrumb: (resolvedOrder: Order) => `Viewing order number ${resolvedOrder.orderNumber} now`
    }
  }]
}

@fgoulet fgoulet added the enhancement New feature or request label Jun 12, 2021
@stale
Copy link

stale bot commented Jul 12, 2021

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.

@stale stale bot added the wontfix This will not be worked on label Jul 12, 2021
@udayvunnam
Copy link
Owner

not stale

@stale stale bot removed the wontfix This will not be worked on label Jul 14, 2021
@stale
Copy link

stale bot commented Sep 12, 2021

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.

@stale stale bot added the wontfix This will not be worked on label Sep 12, 2021
@udayvunnam
Copy link
Owner

not stale

@udayvunnam udayvunnam removed the wontfix This will not be worked on label Sep 19, 2021
@udayvunnam udayvunnam added the help wanted Extra attention is needed label Nov 15, 2021
@stale
Copy link

stale bot commented Mar 17, 2022

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.

@stale stale bot added the wontfix This will not be worked on label Mar 17, 2022
@udayvunnam
Copy link
Owner

not stale

@stale stale bot removed the wontfix This will not be worked on label Mar 17, 2022
@udayvunnam
Copy link
Owner

@fgoulet I have solved this. We will have additional data passed to the breadcrumb label function which you can use to read the resolved data.

        resolve: {
          name: DemoResolver,
        },
        data: {
          breadcrumb: (breadcrumb, activatedRouteSnapshot) => {
            return `Viewing ${activatedRouteSnapshot.data.name} instead of ${breadcrumb} now`;
          },
        },

@fgoulet
Copy link
Author

fgoulet commented Mar 27, 2022

Cool, looks like a good solution.

@stale
Copy link

stale bot commented Jul 30, 2022

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.

@stale stale bot added the wontfix This will not be worked on label Jul 30, 2022
@udayvunnam
Copy link
Owner

not stale

@stale stale bot removed the wontfix This will not be worked on label Aug 3, 2022
@luizagabriela
Copy link

@fgoulet I have solved this. We will have additional data passed to the breadcrumb label function which you can use to read the resolved data.

        resolve: {
          name: DemoResolver,
        },
        data: {
          breadcrumb: (breadcrumb, activatedRouteSnapshot) => {
            return `Viewing ${activatedRouteSnapshot.data.name} instead of ${breadcrumb} now`;
          },
        },

Hi!
Can you please explain where activatedRouteSnapshot comes from? I tried to set on the breadcrumb a value taken from the resolver with the help of activatedRouteSnapshot, but it seems that activatedRouteSnapshot is undefined.

@stale
Copy link

stale bot commented Feb 2, 2023

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.

@stale stale bot added the wontfix This will not be worked on label Feb 2, 2023
@stale stale bot closed this as completed Jun 10, 2023
@udayvunnam udayvunnam reopened this Jun 10, 2023
@stale stale bot removed the wontfix This will not be worked on label Jun 10, 2023
@stale
Copy link

stale bot commented Oct 15, 2023

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.

@stale stale bot added the wontfix This will not be worked on label Oct 15, 2023
@stale stale bot closed this as completed Mar 17, 2024
@udayvunnam udayvunnam removed the wontfix This will not be worked on label Mar 17, 2024
@udayvunnam udayvunnam reopened this Mar 17, 2024
@udayvunnam udayvunnam reopened this Mar 17, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed no-issue-activity
Projects
None yet
Development

No branches or pull requests

3 participants