Skip to content

Vanishing query parameter with reloadOnSearch = false #2356

Closed
@cwmrowe

Description

@cwmrowe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions