Closed crediblebytes closed 9 years ago
What features don't work with 0.2.15?
I haven't found any yet just would be nice to have the official OK before moving into production.
Extras should work with 0.2.15. :+1:
I can't seem to get reloadOnSearch to work correctly with sticky states. I have 2 tabs, each backed by its own controller.
I need to be able to pass some params/search vars from step1 to step2, without reloading the controller.
When using sticky states and a search string or param in the URL, reloadOnSearch is ignored and controller is destroyed and re-instantiated when the tab becomes visible again. Here's a plunker showing this behaviour: http://plnkr.co/edit/JOrtqK2EGOZxhO3cmRie?p=preview (check the console)
Removing the ?update search param from the state stops it from re-instantiating, but I feel passing around params without re-instantiating the view would be the whole point of reloadOnSearch + ui-router-extras.
According to my research, searchOnReload behaves correctly now, here's a related plunker: http://plnkr.co/edit/5OPoKUDnn98JiKFlyEYL?p=preview
$stateProvider
.state('tab1', {
url: '/tab1',
sticky: true,
views: {
tab1: {
controller: 'Tab1Ctrl',
templateUrl: 'tab1.html'
}
}
})
.state('tab2', {
url: '/tab2?update',
sticky: true,
reloadOnSearch: false,
views: {
tab2: {
controller: 'Tab2Ctrl',
templateUrl: 'tab2.html'
}
}
});
PS: Same behaviour is observed when using :param instead of search string. @christopherthielen, should I move this into its own issue?
@anzorb yes, if reloadOnSearch is broken, there should be a separate ticket opened.
The latest ui-router contains some much needed fixes like reloadOnSearch https://github.com/angular-ui/ui-router/releases