Skip to content

State parameters not correctly retained between child-parent transitions #2451

@oliversalzburg

Description

@oliversalzburg

First of all, sorry, but I wasn't able to replicate this in a plunker. So I made a repository instead: https://github.com/oliversalzburg/ui-router-state-params
It builds on top of the default plunker code though, so I hope this will be acceptable.

Steps to reproduce:

  1. Start the application with node app.js and navigate to http://localhost:3006
  2. Click the Page 3 button to change the page parameter to 3. The URL is correctly adjusted to http://localhost:3006/people?page=3.
  3. Click the Go to child state button to navigate to a child state of the current state. The parameters are correctly retained and the URL is changed to http://localhost:3006/people/new?page=3
  4. Click the Go to parent state button. The state parameter page is now lost. The URL has changed to http://localhost:3006/people

In the last step, I would expect to be sent to http://localhost:3006/people?page=3

Additionally, if, in step 1, you open http://localhost:3006/people?page=3 instead, then click the Page 1 button, then go to the child and back to the parent state, you're sent to http://localhost:3006/people?page=3 again, which is the initial state you started with.

So it's not that you always lose all parameters, but the initial parameter set is picked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions