【发布时间】:2018-08-09 16:06:45
【问题描述】:
我有一个组件,它带有一个应该被解析但没有被解析的状态属性。我在会话状态中使用 ngStorage 存储应用程序状态,并且在组件之间导航时加载状态。
$stateProvider.state('app.insure-contents', {
url: '/insure-contents',
views: {
'contents': {
component: 'insureContents',
resolve: {
state: ['$sessionStorage', function ($sessionStorage) {
console.log($sessionStorage.renterState);
return $sessionStorage.renterState;
}]
}
}
}
})
const InsureContents = {
restrict: 'E',
bindings: {
state: '<'
},
controller: InsureContentsCtrl,
templateUrl: 'renters/components/insure-contents.html'
}
组件加载正常,但解析功能似乎没有运行。
【问题讨论】:
标签: angularjs angular-ui-router