-
Notifications
You must be signed in to change notification settings - Fork 3k
Cannot override nested state resolve values #78
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
Comments
Thats definitely meant to work, will have a look |
Ah, just noticing that your controller is defined on the parent state. A controller is only ever going to see 'resolve' values form it's own state and their ancestors. The controller isn't re-created when a child state is entered, so it does not make sense for it to see 'resolve' values of children. A controller defined in 'test.nested' should see 'testValue' = 1 |
I tried to define the same controller in the nested state, but still have the same issue. I added an onEnter function to the nested state to be sure it was hitting the nested state, and it was, but I still always get 0 returned from the testValue resolve. From what I read on the documentation, I expected the resolve to be overridden by the nested state.. "Child states inherit views (templates/controllers) and resolved dependencies from parent state(s), which they can override." |
Are you sure your nested controller is actually being created? I.e. does your template for the parent state's view contain a nested ui-view tag for the nested view to be created in? |
If I have my states defined as such:
And a controller as such:
The controller always traces out a value of 0 for testValue, regardless of whether I navigate to /test or /test/nested. It seems the resolve values in nested states are not overriding the resolve values in the parent state.
The text was updated successfully, but these errors were encountered: