我创建了一个侧面菜单,但我无法获得我想要的观点。我该如何解决这个问题?我的路由工作正常,因为它显示应用程序位于/ app / book url中,但未调用Controller且未呈现视图。我不知道问题是什么,提前谢谢。以下是我的代码:
app.js
.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.state('app', {
url: '/app',
abstract: true,
tenplateUrl: 'templates/side-menu.html',
controller: 'app-CTRL'
})
.state('app.book', {
url: '/book',
views: {
'menuContent': {
templateUrl: 'templates/book-slot.html',
controller: 'book-slot-CTRL'
}
}
})
$urlRouterProvider.otherwise('/app/book');
});
侧menu.html
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-stable">
<h1 class="title">Left</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item>
List
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
书slot.html
<ion-view view-title="book">
<ion-content>
book
</ion-content>
</ion-view>