ncuillery / angular-breadcrumb

Generate a breadcrumb from ui-router's states
http://ncuillery.github.io/angular-breadcrumb/
MIT License
785 stars 183 forks source link

Wrong parent link until refresh #154

Open valentinlamatte opened 8 years ago

valentinlamatte commented 8 years ago

Hi everyone,

The issue I'm facing is the following, I've got a state and his parent like this :

name: 'parentState',
url: '/parentState/:parentStateParam',
templateUrl: 'views/parentState.html',
controller: 'ParentStateController',
ncyBreadcrumb: {
    label: '{{ labelName }}',
    parent: 'home'
}
name: 'childState',
url: '/childState',
templateUrl: 'views/childState.html',
controller: 'ChildStateController',
ncyBreadcrumb: {
    label: '{{ mainTitle }}',
    parent: 'parentState({parentStateParam: childParam})'
}

labelName, childParam and mainTitle are defined in the scope of the ChildStateController and displayed properly. The issue occurs when I come from the parent state, in the url of the parent in the child breadcrumb the parameter is missing, but only the first time I come on this state, if I refresh, the url is the good one with the childParam.

The labelName and the childParam are defined in the same place and can be edited in the ChildStateController, when I edit those one, the label name is dynamically edited but not the link which is supposed to include childParam.

I also have added the $breadcrumb dependency in the run function.

Any idea anyone ?

maxhan247 commented 8 years ago

same issue

vicpon commented 8 years ago

Change the event that handles the update from $viewContentLoaded to $stateChangeSuccess