在头离子导航标签离子、标签

2023-09-13 03:13:14 作者:你的泪是为我而流?

嘿,我已经有了一个大概的离子导航问题,

Hey i've got a question about ionic navigation,

我的应用程序的主导航在页脚,但我想一个信息选项卡添加到头部,我也希望这个标签有它自己的观点,所以我将其设置为可见如下

The main navigation of my application is in the footer, but i want to add an information tab to the header, I also want this tab to have it's own view so i set it up as seen below

 <ion-nav-bar class="bar-stable nav-title-slide-ios7">
  <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">
    Back
  </ion-nav-back-button>
  <ion-nav-buttons side="right">
    <ion-tabs class="tabs-icon-top">

    <!-- Info Tab -->
    <ion-nav-view>
      <ion-tab title="Info" icon="icon ion ion-android-information" href="#/info/informatie">
        <ion-nav-view name="info-informatie"></ion-nav-view>
      </ion-tab>
     </ion-tabs>
    </ion-nav-view>


  </ion-nav-buttons>
</ion-nav-bar>

和我配置的角度路由抽象类这样的,

And I configured the Angular routing to an abstract class like this,

.state('info', {
  url: "/info",
  abstract: true,
  templateUrl: "templates/tabs.html"
})

    .state('info.informatie', {
        url: '/informatie',
        views: { 
            'info-informatie': {
                templateUrl: 'templates/info-informatie.html',
                controller: 'InfoCtrl'
            }
        }
    })

现在,据我可以告诉这应该做的伎俩,但问题是,在

选项​​卡不会在头显示,并且还当我硬连接到路由是在同一页上停留,没有任何类型的错误...

Now as far as i can tell this should do the trick, but the problems are that the tab doesn't show in the header, and also when i hardlink to the route it's stays on the same page without any kind of error...

我所做的模板,并配置了控制器。

i've made the templates, and configured the controllers.

我是新与角度,以及离子所以它可能是很容易的,但我不出来..我读过的手册和文档。

I'm new with Angular as well as Ionic so it might be something quite easy but i can't figure it out.. i've read the manuals and the docs.

!重要通知当我更改视图到另一个像

!!IMPORTANT NOTICE When i change the view to another one like

.state('info.informatie', {
        url: '/informatie',
        views: { 
            'TAB-OMGEVING': {
                templateUrl: 'templates/info-informatie.html',
                controller: 'InfoCtrl'
            }
        }

它的工作原理,但活跃的状态放在另一个选项卡上和历史堆栈追溯该选项卡这是不是我想要做的,我宁愿做它从一开始,然后建立与廉价的修补程序和应用程序错误的使用codeS。

it works, but the active state is placed on another tab and the history stack traces back to that tab which is not what I intend to do and i would rather do it right from the start then build an app with cheap fixes and wrong use of codes.

有人能帮助我吗?

推荐答案

几个点,林新本太多,但希望一些帮助林。

A few points, Im new to this too but hope Im of some help.

我觉得你的code,应在导航栏段,导航视图应该留空作为的地方你的HTML填充使用UI-SREF,而不是href..like &LT;一个UI的SREF ='info.informatie'&GT;东西&LT; / A&GT; 或选择使用一个按钮以雇工的UI SREF为好。因为u使用info.something,自然你的父母或基态是信息的状态。 I think your code should be in the nav-bar segment, nav-view should be left empty as its the place where your html populates use ui-sref instead of href..like <a ui-sref='info.informatie'>something</a>or alternatively use a button to employe ui-sref as well. because u use info.something, naturally your parent or base state is info state.