我希望在使用状态提供程序的页面中拥有单父视图和部分子视图。
AngularJs代码:
state('packs', {
//controller:'PacksController',
abstract:true,
views: {
'@': {
template:'<ui-view/>',
controller: 'PacksController',
controllerAs: 'packctrl'
},
'header@': {
templateUrl: 'static/vendor/views/packs.html',
controller: 'PacksController',
controllerAs: 'packctrl'
}
}
})
.state('packs.general',{
parent:'packs',
url:'/general',
views: {
'@': {
templateUrl:'static/vendor/views/packs.general.html',
controller: 'PacksController',
controllerAs:'packctrl'
}
}
})
Html代码是:
<div ui-view></div>
答案 0 :(得分:0)
Multiple Named Views
此问题似乎已经存在answer
<body>
<div ui-view="filters"></div>
<div ui-view="tabledata"></div>
<div ui-view="graph"></div>
</body>
路由器定义:
$stateProvider
.state('report', {
views: {
'filters': { ... templates and/or controllers ... },
'tabledata': {},
'graph': {},
}
})