我使用 Ionic 和 AngularJS 以这种方式有一些按钮:
<li menu-close class="item item-icon-left sider itemCustomColor" ng-click="go('#/app/contactus')">
<i class="icon ion-home"></i> Home
</li>
go 方法在我的 Controller 中的位置:
$scope.go = function (url) {
try {
$location.path(url);
} catch(err) {
alert(err);
}
}
当我在某个页面中,然后通过它显示的按钮移动到其他页面时,它以某种方式工作:
正如您所看到的,前面的页面有一个“后退”按钮,我想继续像以前一样显示,例如:
当我将其放入 <a href="#link">
时,我可以模拟该行为。标签,我有一些特定的主题(是另一个历史),我想在我的 Controller 中实现它。
我怎样才能做到这一点?
最佳答案
添加hide-back-button="true"
到您的 ion-view 标签。
要显示您之前拥有的内容,可以在 ion-content 之前添加以下内容:
<ion-nav-buttons side="left"> //Add the code for your item here
</ion-nav-buttons>
关于javascript - 不使用 "back"按钮更改 View Ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34982034/