Angularjs +离子框架:如何创建,显示离子的标签导航,但没有界定本身就是一个标签一个新的路线? [英] Angularjs + Ionic Framework: How to create a new route that shows the ion-tabs navigation but without defining a tab for itself?

查看:139
本文介绍了Angularjs +离子框架:如何创建,显示离子的标签导航,但没有界定本身就是一个标签一个新的路线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

龙冠军,但这里是一个更好的解释。

Long title but here is a better explanation.

我有一个名为登录的模板HTML文件。我在app.js定义路由像这样

I have a template html file called "Login". I define a route in app.js like so

.state('login', {
  url: '/login',
  templateUrl: 'templates/login.html',
  controller: 'createAccountCtrl'
})

通过使用UI-SREF =登陆我可以从任何地方连接到这个模板是适合我的需求。

By using ui-sref="login" I can link to this template from anywhere which is perfect for my needs.

但主要的应用程序使用一个抽象路径选项卡加载包含主导航标签模板。

However the main app uses an abstract route "tab" to load the tabs template which contains the main navigation.

.state('tab.about', {
  url: '/about',
  views: {
    'about-tab': {
       templateUrl: 'templates/about.html',
       controller: 'aboutCtrl'
     }
   }
})

  <ion-tabs tabs-style="tabs-icon-top" tabs-type="tabs-default">

    <!-- Home Tab -->
    <ion-tab title="Home" icon="icon ion-home" href="#/tab/home">
      <ion-nav-view name="home-tab"></ion-nav-view>
    </ion-tab>

    <!-- Products Tab -->
    <ion-tab title="Earn Points" icon="icon ion-ios7-plus-outline" href="#/tab/retail-store">
      <ion-nav-view name="retail-store-tab"></ion-nav-view>
    </ion-tab>

  </ion-tabs>

我的问题是这样的。我想登录页面有主应用程序的导航像其他页面了。这样,谁它对登录页面,如果他们不登录仍可以导航到关在家中或有关网页的用户。但是,我不希望它自己的导航标签/图标来显示。

My problem is this. I want the Login page to have the main app's navigation like every other page has. That way a user who makes it to the login page, if they don't to login can still navigate off to the home or about page. But, I do not want a navigation tab/icon of its own to show.

时可以只直接添加HTML标签到login.html的模板文件或可能隐藏登录图标/标签。我打开的建议和帮助。谢谢!

Is is possible to just add the tabs html directly to the login.html template file or possibly hide the login icon/tab. I am open to suggestions and help. Thank you!

推荐答案

的选项卡是为了拥有自己的标签的图标。所以你不能把抽象的标签视图内登录页面,而不为其创建一个标签图标。

The tabs are meant to have their own tab icon. So you can't put the login page inside the tabs abstract view without creating a tab icon for it.

而不是把登录页面的标签抽象视图下,你应该只是把一个单独的标签导航登录页面。

Instead of putting the login page under the tab abstract view, you should just put a separate tabbed navigation for the login page.

加载下面的视图到您的索引页。

Load the following view into your index page.

<ion-view title="'Login'">

<ion-content has-header="true" has-footer="true" padding="true">

Login page content goes here 

</ion-content>

<div class="tabs tabs-icon-left">
  <a class="tab-item" href="#/tab/home">
   Home
  </a>
  <a class="tab-item" href="#/tab/about">
    About
  </a>
</div>

</ion-view>

这篇关于Angularjs +离子框架:如何创建,显示离子的标签导航,但没有界定本身就是一个标签一个新的路线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆