我有一个定义如下的side menu页面:
<body>
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
</ion-nav-bar>
<ion-nav-view animation="slide-in-right"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-assertive">
<h1 class="title">Menu</h1>
</ion-header-bar>
<ion-content>
<div class="list side-menu-list">
<a class="item item-icon-left" ui-sref="home" menu-toggle="left">
<i class="icon ion-home"></i>
Home
</a>
<a class="item item-icon-left" ui-sref="help" menu-toggle="left">
<i class="icon ion-help-circled"></i>
Help
</a>
<a class="item item-icon-left" ui-sref="exit" menu-toggle="left" ng-click="exitApp()">
<i class="icon ion-power"></i>
Exit
</a>
</div>
</ion-content>
</ion-side-menu>
</ion-side-menus>
<! -- scripts -->
</body>现在,为了处理这些状态,我设置了这样一个路由器;
.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: "/home",
templateUrl: "templates/home.html"
})
.state('help', {
url: "/help",
templateUrl: "templates/help.html",
controller: "HelpController"
});
$urlRouterProvider.otherwise("/home");
}下面是我在templates folder中的模板文件
<! --home.html -->
<ion-view title="HOME">
<ion-content class="padding">
<h1>I am Home</h1>
</ion-content>
</ion-view>help.html也是如此
现在是问题的部分。当我使用来自home或help的链接导航到side menu或side menu时,页面主体总是以从左滑两次而结束。标题栏的行为正常。但是页面的主体会滑动两次,然后进入静止状态。
例如,当我在home.html中时,在侧菜单 then the body of the page 'help' which is "I AM HELP" slides twice from left then comes into rest.中单击"HELP"
基本上,event并没有停止。Bubbling phase is firing twice。我怎么才能解决这个问题?
我在JQM上也有类似的问题,我曾经用event.stopImmediate.Propogation()来解决这个问题。我怎么用Ionic and AngularJS.在这里做呢?
或者还有其他的解决方案或者我做错了什么?
发布于 2014-08-26 20:00:37
这可能是由于两次引用angularjs造成的,如果您这样做,它将执行整个框架两次。请检查你是否多次上膛安古拉杰。
发布于 2014-09-08 15:27:03
您可能会使用<ion-nav-view animation="slide-in-right"></ion-nav-view>的html插入侧菜单页面,但请记住,index.html在视图部分中具有相同的内容。
尝试删除菜单页的html中的幻灯片,并查看它是否有效。
https://stackoverflow.com/questions/23546470
复制相似问题