我正在使用有角度的 UI 路由器。我的路线配置中有以下内容
.config(function config($stateProvider) {
$stateProvider.state('newsFeedView', {
url: '/newsFeed',
controller: 'newsFeedController',
templateUrl: '../src/app/bulletinBoard/views/newsFeed.part.html',
data: {
pageTitle: 'News Feed'
}
})
.state('tradeFeedView', {
url: '/tradeFeed',
controller: 'tradeFeedController',
templateUrl: '../src/app/bulletinBoard/views/tradeFeed.part.html',
data: {
pageTitle: 'Trade Feed'
}
})
.state('bulletinBoard', {
url: '/bulletinBoard',
views: {
'tradeFeed': {
url: "",
controller: 'tradeFeedController',
templateUrl: '../src/app/bulletinBoard/views/tradeFeed.part.html'
},
'newsFeed': {
url: "",
controller: 'newsFeedController',
templateUrl: '../src/app/bulletinBoard/views/newsFeed.part.html'
}
},
templateUrl: '../src/app/bulletinBoard/views/bulletinBoard.part.html'
});
})
在我的索引页面中,我只是使用以下方式调用视图:
<div class="container" ui-view></div>
在我的BulletinBoard.html 中我想要一个嵌套视图:
<div ui-view="tradeFeed"></div>
<div ui-view="newsFeed"></div>
对于 /newsFeed 页面和 /tradeFeed 页面,这工作得很好,但对于公告板,我在页面上看不到任何内容。我哪里出错了?