Dynamic params and query params, url not updated?
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?
No you shouldn't need to manually update the URL. This sounds like a bug.
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?
@christopherthielen wonder this is related to https://github.com/angular-ui/ui-router/issues/2723
@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
moving to alpha.6 milestone while waiting for info from @Ben305
Closing due to no activity