Skip to content

Vanishing query parameter with reloadOnSearch = false #2356

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
cwmrowe opened this issue Nov 4, 2015 · 1 comment
Closed

Vanishing query parameter with reloadOnSearch = false #2356

cwmrowe opened this issue Nov 4, 2015 · 1 comment
Labels
Milestone

Comments

@cwmrowe
Copy link
Contributor

cwmrowe commented Nov 4, 2015

The problem occurs when I have some nested states with a optional search parameter at the top level and reloadOnSearch is set to false. e.g.

$stateProvider
    .state('top', {
      url: '/top?myParam',
      reloadOnSearch: false,
      template: '<h1>Top</h1><ui-view></ui-view>'
    }).state('top.firstLevel', {
      url: '/first',
      reloadOnSearch: false,
      template: '<h1>First</h1><ui-view></ui-view>'
    }).state('top.firstLevel.secondLevel', {
      url: '/second',
      reloadOnSearch: false,
      template: '<h1>Second</h1><ui-view></ui-view>'
    });

If I enter the 'top.firstLevel.secondLevel' state and set the search parameter myParam to a value and then change the state to a parent state, the value is lost. Even though it is present in the toParams on the state change event.

I would expect the value or myParam to remain no matter how I moved between these states.

Plunker here

@eddiemonge eddiemonge added the bug label Nov 6, 2015
@eddiemonge
Copy link
Contributor

Confirm this is a bug. Removing reloadOnSearch keeps the param

@christopherthielen christopherthielen added this to the 0.2.16 milestone Jan 23, 2016
ExpFront pushed a commit to ExpFront/ui-router that referenced this issue Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants