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.

Dynamic breadcrumb labels are empty on page reload

See original GitHub issue

I have a page that lists locations with the ability to click on a location to see details. The breadcrumbs work fine when clicking on an item from the list (Home > Locations > State > City > Location name).

The problem is if you’re on a location detail page and reload the page in your browser then the dynamic labels in the breadcrumb are empty (Home > Locations > > >). The details page displays fine otherwise

There is a common on another issue mentioning this same problem. https://github.com/ncuillery/angular-breadcrumb/issues/107#issuecomment-143161637

      .state('app.locations.detail', {
        url: '/:id',
        views: {
          'content@': {
            controller: 'LocationDisplayController',
            templateUrl: '/app/location/html/location-detail.html',
          }
        },
        ncyBreadcrumb: {
          label: '{{location.name}}',
          parent: 'app.locations.city'
        },
      });

Note: the problem is still there even if I simplify the breadcrumbs so that location names immediately follow the default app state.

If I change the label to Testing {{location.name}} then you will see Home > Locations > > > Testing.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

6reactions
ismailatkurtcommented, Dec 2, 2015

If you use $rootScope instead of $scope at controller it will work. But i’m not sure its the right way?

  $rootScope.foo = 'test';

will be work perfect at:

ncyBreadcrumb: {
    label: '{{foo}}',
    parent: 'myparent'
},
2reactions
nbasovcommented, Mar 16, 2016

Here is an old issue about this problem https://github.com/ncuillery/angular-breadcrumb/issues/42 Solved by injecting $breadcrumb into application .run method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular / xng-breadcrumbs disappear on page reload
The breadcrumbs are empty after page reload. Minimal reproducible example is: this Stackblitz, where navigating to parent/child2 route renders ...
Read more >
Build dynamic breadcrumb routes and child routes with ...
Let alone need to implement a custom route for every new page. ... Be able to show dynamic breadcrumb titles based on parameters....
Read more >
How to implement breadcrumb navigation in Angular and ...
In data object, we declare breadcrumb property which is a label of a breadcrumb menu item. You probably noticed that I assigned a...
Read more >
Rails Tutorial | Adding Dynamic Breadcrumbs to a Rails App
In this Ruby on Rails tutorial, we're going to create a method for easily adding dynamic breadcrumbs to our application without complex ...
Read more >
Adding Breadcrumb to my kendo grid toolbar template not ...
Could you examine the solution and verify if it works correctly on your end? If this is the case, I would suggest to...
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