Skip to content

Parent resolve overwritten when changing state param #883

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

Closed
KrisBraun opened this issue Feb 12, 2014 · 3 comments
Closed

Parent resolve overwritten when changing state param #883

KrisBraun opened this issue Feb 12, 2014 · 3 comments

Comments

@KrisBraun
Copy link

I have nested states, each with resolve properties, something like this:

  .state 'parent',
    url: '/:parentId'
    resolve:
      resolve1: -> ...
  .state 'parent.child'
    url: '/:childId'
    resolve:
      resolve2: -> ...
    views:
      template: '<p>test</p>'
      controller: (resolve1, resolve2) ->

When first loading a child page, I see the proper objects injected in the controller. When navigating to a page that changes the :childId but leaves the :parentId the same, both resolve1 and resolve2 are set to the same object, the new resolve2 object. I've verified the parent resolve is not being called a second time. So it seems the the wrong object is getting injected in the second case.

I need more time to make a Plunkr reproducing the issue but thought I'd put this out there in case someone already knows what is going on.

@KrisBraun
Copy link
Author

Duplicating the parent resolve in the child fixes the problem, but obviously duplicates code and causes the resolve to be re-fetched even if the parent doesn't change. So it's definitely something about child state transitions and parent resolve properties.

@timkindberg
Copy link
Contributor

Seems like this is related to #702

@eddiemonge
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants