Ionic framework 离子导航视图工作不正常
因此,在爱奥尼亚,我正在使用带导航视图的ui路由器,但它似乎无法正常工作: app.jsIonic framework 离子导航视图工作不正常,ionic-framework,angular-ui-router,Ionic Framework,Angular Ui Router,因此,在爱奥尼亚,我正在使用带导航视图的ui路由器,但它似乎无法正常工作: app.js app.config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('app', { url: '/app', abstract: true, templateUrl: 'templates/home.html' }) .state('app.book', {
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/home.html'
})
.state('app.book', {
url: '/book',
views: {
'menuContent': {
templateUrl: 'templates/book.html'
}
}
})
.state('app.service', {
url: '/service',
views: {
'menuContent': {
templateUrl: 'templates/service.html',
controller: 'ServiceController'
}
}
})
$urlRouterProvider.otherwise('/app/book');
home.html:
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-header-bar align-title="left" class="bar-positive">
<button class="button icon-left ion-navicon-round button-clear " menu-toggle="left"> </button>
<h1 class="title">Maalish</h1>
</ion-header-bar>
<ion-nav-view name="menuContent"></ion-nav-view>//Nav View
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-content>
<ion-list>
<ion-item item-icon-left menu-close href="#/app/splash">
<i class="icon ion-home"></i>
  Home
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
玛利斯
//导航视图
&家
Book.html
<ion-view view-title="book">
<ion-content class="book-content">
Hi
<a href="#/app/service">Click </a>
</ion-content>
</ion-view>
你好
Service.html:
<ion-view view-title="service">
<ion-content class="book-content">
Hey
</ion-content>
</ion-view>
嘿
下面是一个小说明:
Home.html—它在所有页面/屏幕上都有其父屏幕所需的侧菜单
html:它是指向service.html的第一个屏幕链接
html:这是第二个屏幕
问题:
因此,当我打开应用程序时,book.html打开,它有侧菜单(home.html),但当我单击link service.html时,页面打开,但它没有侧菜单。如果我只刷新service.html的链接,则侧菜单打开。
当从book.html重定向时,侧菜单不会出现。解决了它,您只需更改为,即将true更改为false