Friday, August 3, 2018

angularjs - How to change url by changing $stateParams without reloading page

I have a route with parameter defined:



$stateProvider
.state('item', {..})

.state('item.view', {
url: 'item/:id'
template: '...',
controller: '...'
});


While already in item.view state, I would like to switch the url with



$state.go('item.view', {id: 'someId'})



without reloading the page. I have tried:



$state.go('item.view', {id: 'someId'}, {notify: false});
$state.go('item.view', {id: 'someId'}, {notify: false, reload: false});


Both still cause the page to reload. I think i may be running into the issue described here: https://github.com/angular-ui/ui-router/issues/1758

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...