如何在不刷新其父项(项目)的情况下刷新“详细信息”状态。 在 route :
$stateProvider.state('item.detail', {
url: '/:id/detail',
abstract: true,
resolve: {
$modal: ['$modal', function ($modal) {
return $modal;
}]
},
onEnter: ['$state', '$modal', function ($state, $modal) {
$modal
.open({
templateUrl: 'detail.html',
backdrop: 'static'
})
.result.then(function () {
$state.transitionTo('item.detail', {id: $state.params.id}, {reload: true});
})
;
}]
})
这会同时刷新项目和详细信息。
添加要重新加载的状态也不起作用。 知道我做错了什么吗?
最佳答案
是this你想要做什么,我认为有趣的部分是重新加载参数(你正在使用):
If reload is a string (or state object), the state object is fetched (by name, or object reference); and \ the transition reloads the resolves and views for that matched state, and all its children states.
关于javascript - 在 Angular 中刷新状态而不刷新其主视图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43637897/