I have a problem with nested views in ui-router.
My layout:
site.search
-----------------
site.search.runs
-----------------
site.search.runs.scheme
-----------------
site.search.runs.scheme.payment
-----------------
I do not want to change the URL, so I use $state.go('', {}, {location:false});
I also use $stage.go('^'...)to return to the parent.
But when I click the back button on site.search.runs.scheme.payment or site.search.runs.scheme, the controller also reboots (I do not use {reload: true}).
How to prevent rebooting of the parent top-level controller?
I found a problem like my https://github.com/angular-ui/ui-router/issues/2096
Can anyone help me?
My configuration
$stateProvider
.state('site', {
abstract: true,
url: '',
template: '<ui-view/>'
})
.state('site.search', {
url: '',
parent: 'site',
controller: 'SearchController',
controllerAs: 'search',
templateUrl: 'js/search/search.tpl.html'
})
.state('site.search.runs', {
url: '',
parent: 'site.search',
params: {back: false, timestamp: 0, search: {}},
controller: 'RunsController as runsCtrl',
templateUrl: 'js/runs/runs.tpl.html'
})
.state('site.search.runs.scheme', {
url: '',
parent: 'site.search.runs',
params: {back: false, run: ''},
controller: 'SchemeController as schemeCtrl',
templateUrl: 'js/scheme/scheme.tpl.html'
})
.state('site.search.runs.scheme.payment', {
url: '',
parent: 'site.search.runs.scheme',
params: {back: false},
controller: 'PaymentController as payCtrl',
templateUrl: 'js/payment/liqpay/payment.tpl.html'
})
});
$state.go('^', {: true}, {location: false, inherit: false});