Skip to content
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

Dynamic params and query params, url not updated? #2709

Closed
Ben305 opened this issue Apr 24, 2016 · 6 comments
Closed

Dynamic params and query params, url not updated? #2709

Ben305 opened this issue Apr 24, 2016 · 6 comments

Comments

@Ben305
Copy link

Ben305 commented Apr 24, 2016

Hi there, I'm using version 1.0.0-alpha.4 because I have the following use case:

I have to implement a search, and the parameters are passed via query params like this: /search?city=Boston&start=2016-01-01&end=2016-01-10

The state is defined like this:

$stateProvider.state('search', {
    url: '/search?city&startDate&endDate',
    templateUrl: 'some/url/template.html',  
    params: {
        city: {
             value: 'Boston'
         dynamic: true
    },
    startDate: {
         value: '2016-01-01',
        dynamic: true
    },
    endDate: {
        value: '2016-01-10',
        dynamic: true
    }
}

Everything is working well, and when the user updates the parameters, I'm calling $state.go($state.current.name, newStateParams);, and the callback function uiOnParamsChanged is also called correctly.

Only the parameters in the url are not updated. So when the user wants to search in Chicago, the url is still search?city=Boston... after the state-change. Is this the correct behavior? Do I have to update the url manually?

@christopherthielen
Copy link
Contributor

No you shouldn't need to manually update the URL. This sounds like a bug.

@dracula92107
Copy link

Hi,
I have a similar issue.
My define:

$stateProvider.state('zone', {
    url: '/zone-:zoneId',
    templateUrl: '/zone-detail.html',
    controller: 'zoneController'
});

When I click on link on view (use ui-sref) or use $state.go, it redirect success. But when I change the zoneId on address bar -> state not change.
The back button not work, too.

Test on Chrome.

Is this a bug?

@samithaf
Copy link

samithaf commented May 2, 2016

@christopherthielen wonder this is related to #2723

@christopherthielen
Copy link
Contributor

@Ben305 Here is a working plunker: http://plnkr.co/edit/0ww2TBT2WNPkZauuvEjT?p=preview

Can you provide additional information? The URL should be updating.

@dracula92107 I think you have a different problem, but you haven't provided enough information to give an answer.

Can you open a new issue, and provide a plunker that reproduces the error? Start here: http://bit.ly/UIR-Plunk

@christopherthielen christopherthielen modified the milestones: 1.0.0-alpha.6, 1.0.0-alpha.5 May 12, 2016
@christopherthielen
Copy link
Contributor

moving to alpha.6 milestone while waiting for info from @Ben305

@christopherthielen christopherthielen removed this from the 1.0.0-alpha.6 milestone Jun 26, 2016
@christopherthielen
Copy link
Contributor

Closing due to no activity

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

No branches or pull requests

4 participants