javascript - 不使用 "back"按钮更改 View Ionic

标签 javascript angularjs ionic-framework

我使用 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);
        }
    }

当我在某个页面中,然后通过它显示的按钮移动到其他页面时,它以某种方式工作:

enter image description here

正如您所看到的,前面的页面有一个“后退”按钮,我想继续像以前一样显示,例如:

enter image description here

当我将其放入 <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/

相关文章:

javascript - 使用 create-react-app 的多模块项目

c# - ASP.Net MVC Web Api 函数为完全不同的调用返回错误

javascript - Angular ng 在下拉列表中重复和过滤

Angular 5在两个组件之间共享函数和变量

android - ionic 标签 : content not fitting when changing platform

javascript - CORS 策略 : Response to preflight request doesn't pass access control check

javascript - 无法使用 Node.js 发回 .json 数据(Cors 错误)

javascript - AngularJS + UI-Grid + Bootstrap 选项卡 + 应用程序性能

javascript - Angular : displaying elements in navbar after logged in

android - Phonegap - 忽略 Android 上的字体大小显示设置