-
Notifications
You must be signed in to change notification settings - Fork 184
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
Breadcrumbs not triggering re-render when changing between parent and child states #159
Comments
I think there was a similar issue in #154 |
@CSchulz good pick up! title of the other issue didnt seem related, but the solution appears the same. Questions still stand, but happy to be merged/marked as duplicate if they can be added to the other issue.
|
@haxxxton 'When i changed all references to $stateChangeSuccess this solved the problem.' How do you do that ? :) |
@ptitdje45, i created a fork of this repo and did a find and replace for all instances of
If this use case is not something you need to worry about, feel free to use my code here: https://github.com/haxxxton/angular-breadcrumb |
@haxxxton Thanks buddy :) |
What I find strange is that the directive and the service both have edit: On closer inspection, My routing setup currently has an |
@p0lar-bear did you have a go using my suggested change of |
In my case, it wouldn't have done anything. It doesn't seem like I will keep this in mind for once my app's states are properly defined, though. Also, I think it's prudent to call attention to the fact that these state change events were deprecated with ui-router v1.0. The ui-router team has provided polyfills for them, and while this is a valid stopgap, this breadcrumb module should be updated to use the transition hook API instead of these events. |
I thing I have the same problem. @haxxxton I've tried 2 things :
In both cases it's not fixed anything. Any idea ? |
I was struggling to figure out why when toggling between child and parent states the breadcrumbs werent updating (they would stay as the page rendered them if deep linking into a child state, or at the parent state if going to a new 'root' state)
My state config looked like:
in the base template i used the breadcrumb directive
If i deep linked into
app.foo.add
the breadcrumbs would correctly showHome \ Foo \ Add
however, clicking on a button that usedui-sref="app.foo"
would leave the breadcrumbs as above.I realised that breadcrumbs triggers a re-render on
$viewContentLoaded
. Which wasnt being triggered when the states changed between child and parent views. When i changed all references to$stateChangeSuccess
this solved the problem.Is there a reason that
$viewContentLoaded
is used instead of$stateChangeSuccess
? am i likely to encounter any issues with this?The text was updated successfully, but these errors were encountered: