ncuillery / angular-breadcrumb

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

Does not work with sticky states #116

Open arunkjn opened 8 years ago

arunkjn commented 8 years ago

Hi ,

I have a parent state and a few 'sticky' child states. The breadcrumbs run fine for each state once, but fail to update thereon as the state is already active and is just displayed

kanbara commented 8 years ago

+1 I have the same issue.

ncuillery commented 8 years ago

I don't understand the situation, please can you develop ? (an example)

What do you mean by "sticky state" ?

kanbara commented 8 years ago

When using sticky-state from ui-router-extras switching between tabs that are both "sticky" the breadcrumb doesn't change, because the views persist.

I suspect it's an issue with ui-router, but I'm not sure what the fix would be.

ncuillery commented 8 years ago

Oooops ok thanks :smile:

I'll dig into that.

arunkjn commented 8 years ago

https://github.com/ncuillery/angular-breadcrumb/blob/master/src/angular-breadcrumb.js#L35

This seems to be the cause.

The viewContentLoaded event will not fire when transitioning to an already active state.

We should be using $stateChangeSuccess event maybe. I don't have time to test this but happy to do that later