Angularjs ui路由器对继承对象参数的更改未持久化为同级状态
我正试图建立一些州,如下所示Angularjs ui路由器对继承对象参数的更改未持久化为同级状态,angularjs,angular-ui-router,Angularjs,Angular Ui Router,我正试图建立一些州,如下所示 state('search', { url: '', templateUrl: '/modules/core/views/search.html', controller: 'SearchController' }). state('check', { controller: 'CheckController', abstract: true, template: '<ui-view></ui-view>', pa
state('search', {
url: '',
templateUrl: '/modules/core/views/search.html',
controller: 'SearchController'
}).
state('check', {
controller: 'CheckController',
abstract: true,
template: '<ui-view></ui-view>',
params: {
subject: null
}
}).
state('check.status', {
templateUrl: '/modules/core/views/check-status.client.view.html'
}).
state('check.personal', {
templateUrl: '/modules/core/views/check-personal.client.view.html'
});
从抽象父级中删除param,将其添加到旅程中的第一个状态,并使用一个小控制器在父级作用域上分配属性 我认为在您的子状态配置中,您可以告诉ui路由器防止重新加载:
state('check.status', {
templateUrl: '/modules/core/views/check-status.client.view.html',
reloadOnSearch: false
})
对持久数据使用resolve block…@PoyrazYilmaz你能详细说明一下吗?这不起作用-我认为只适用于URL参数。
state('check.status', {
templateUrl: '/modules/core/views/check-status.client.view.html',
reloadOnSearch: false
})