不显示"离子标签"在页面细节 [英] Not displaying "ion-tab" in page detail

查看:123
本文介绍了不显示"离子标签"在页面细节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我有一个code,我已经显示的项目而导致我到一个页面,显示每个项目的细节,但此页面不显示我的离子-Tab

任何帮助

感谢您

附件codeS:

路由器:

 的.config(函数($ stateProvider,$ urlRouterProvider,$ ionicConfigProvider){
    $ ionicConfigProvider.navBar.alignTitle(中心);
    $ stateProvider
        .STATE(应用程序,{
            templateUrl:模板/ app.html
            网址:/应用程序
            摘要:真
        })
        .STATE(app.noticias,{
            网址:/新闻短片
            观点:{
                APP-新闻短片:{
                    templateUrl:模板/ noticias.html
                    控制器:noticiasCtrl
                }
            }
        })
        .STATE('forgotpassword',{
          网址:/忘记密码/:????ID针锋相对BGD FEC COM,
          templateUrl:模板/忘记-password.html
        })
        $ urlRouterProvider.otherwise(/应用程序/消息报);})

code:

 <离子视图标题=新闻短片>
    <离子含量NG控制器=noticiasCtrl的风格=顶部:0>
          <离子列表>
            <离子项目NG重复= CLASS =项目 - 新闻短片叠加吴式={'背景'在rawData.slice(1,N)项:URL(IMG /'+ item.bg + ')不重复中心','背景大小':'盖'}>
                < D​​IV CLASS =叠加UI-SREF =forgotpassword({ID:item.tipo,针锋相对:item.titulo,BGD:item.bgdetail,COM:item.com,FEC:item.fec})>
                    <跨度类=TIPO> {{item.tipo}}< / SPAN>
                    <跨度类=TITULO> {{item.titulo}}< / SPAN>
                    <跨度类=链接>阅读更多< IMG SRC =IMG /右arrow.png>< / SPAN>
                < / DIV>
            < /离子项目>
          < /离子列表>
      < /离子含量>
< /离子视图>

页细节:

 <离子视图标题=forgotpassword>
  <离子NAV-按键侧=左>
    <按钮类=按钮NG点击=$ ionicGoBack($事件)>< /按钮>
  < /离子NAV-按钮>
  <离子含量NG控制器=noticiasCtrl的风格=顶部:0>
    < D​​IV CLASS =头图像NG式={'背景':'URL(IMG /'+ BGD +')不重复中心','背景大小':'盖'}>
    < D​​IV CLASS =overlayPrinD>
      < D​​IV CLASS =overlayPrinSecD>
            <跨度类=TIPO> {{ID}}< / SPAN>
            <跨度类=TITULO> {{针锋相对}}< / SPAN>
      < / DIV>
    < / DIV>
  < / DIV>
  < p =类FEC> {{FEC}}< / P>
  < p =类texto> {{} COM}< / P>
  < /离子含量>
< /离子视图>


解决方案

我不明白你在标记使用离子标签指示的任何地方。我无法从你的问题告诉这些观点都应该是在标签,所以这里的通用的解决方案可以作为一个例子是:

  //路线
.STATE('dashboard.tabs',{
    网址:/标签
    摘要:真实,
    templateUrl:模板/制表container.html
}).STATE('dashboard.tab1',{
    网址:/ TAB1
    观点:{
        TAB1标签:{
            templateUrl:模板/ tab1.html
            控制器:'Tab1Ctrl为虚拟机,
        }
    }
}).STATE('dashboard.tab2',{
    网址:/ TAB2
    观点:{
        TAB2标签:{
            templateUrl:模板/ tabs2.html
            控制器:'Tab2Ctrl为虚拟机,
        }
    }
})//标签标记为制表container.html模板
<离子查看查看标题=一些标题>
    <离子标签类=标签阳性>        <离子分页标题=标签1UI-SREF =some.route.item1>
            <离子导航视图名称=TAB1标签>< /离子NAV-视图>
        < /离子标签>        <离子分页标题=标签2UI-SREF =some.route.item2>
            <离子导航视图名称=TAB2标签>< /离子NAV-视图>
        < /离子标签>    < /离子标签>
< /离子视图>// TAB1和/或TAB2模板
<离子查看查看标题=#标签>
    <离子含量>
        //你的内容
    < /离子含量>
< /离子视图>

您也可以使用脚本标签和NG-模板包括在容器模板中的各个选项卡标记。

 <脚本ID =模板/ tab1.html类型=文/ NG-模板>
  <离子查看查看标题=标签1>
    <离子内容类=填充>
      &所述p为H.;
        //你的内容
      &所述; / P>
    < /离子含量>
  < /离子视图>
< / SCRIPT>

I have a problem, i have a code that I have displayed item which lead me to a page where shows detail of each item but this page does not show me the " ion -tab "

Any help

Thank You

Annex codes:

router:

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider){     
    $ionicConfigProvider.navBar.alignTitle("center");       
    $stateProvider
        .state("app",{
            templateUrl: "templates/app.html",
            url: "/app",
            abstract: true
        })
        .state("app.noticias", {
            url: "/noticias",
            views: {
                "app-noticias":{
                    templateUrl: "templates/noticias.html",
                    controller: "noticiasCtrl"
                }
            }
        })                  
        .state('forgotpassword', {
          url: "/forgot-password/:id?tit?bgd?fec?com",
          templateUrl: "templates/forgot-password.html"
        })          
        $urlRouterProvider.otherwise("/app/noticias");

})

code:

<ion-view title="Noticias">    
    <ion-content ng-controller="noticiasCtrl" style="top:0">              
          <ion-list>
            <ion-item ng-repeat="item in rawData.slice(1, n)" class="item-noticias overlay" ng-style="{'background':'url(img/'+item.bg +') no-repeat center', 'background-size':'cover'}">                
                <div class="overlay" ui-sref="forgotpassword({ id: item.tipo, tit: item.titulo, bgd:item.bgdetail, com:item.com, fec:item.fec })">       
                    <span class="tipo">{{ item.tipo }}</span>
                    <span class="titulo">{{ item.titulo }}</span>
                    <span class="link">Leer mas <img src="img/right-arrow.png"></span>                    
                </div>                        
            </ion-item>
          </ion-list>             
      </ion-content>    
</ion-view>

Page detail:

<ion-view title="forgotpassword">
  <ion-nav-buttons side="left">
    <button class="button" ng-click="$ionicGoBack($event)"></button>
  </ion-nav-buttons>
  <ion-content ng-controller="noticiasCtrl" style="top:0">    
    <div class="header-image" ng-style="{'background':'url(img/'+bgd +') no-repeat center', 'background-size':'cover'}">
    <div class="overlayPrinD"> 
      <div class="overlayPrinSecD">                 
            <span class="tipo">{{ id }}</span>
            <span class="titulo">{{ tit }}</span>                               
      </div>                
    </div>       
  </div>
  <p class="fec">{{ fec }}</p>
  <p class="texto">{{ com }}</p>
  </ion-content>
</ion-view>

解决方案

I don't see you using the ion-tab directive anywhere in the markup. I can't tell from your question which views are supposed to be in the tabs, so here's generic solution you can use as an example:

// Routes
.state('dashboard.tabs', {
    url: "/tabs",
    abstract: true,
    templateUrl: "templates/tab-container.html"
})

.state('dashboard.tab1', {
    url: "/tab1",
    views: {
        'tab1-tab': {
            templateUrl: "templates/tab1.html",
            controller: 'Tab1Ctrl as vm',
        }
    }
})

.state('dashboard.tab2', {
    url: "/tab2",
    views: {
        'tab2-tab': {
            templateUrl: "templates/tabs2.html",
            controller: 'Tab2Ctrl as vm',
        }
    }
})

// Tab markup for tab-container.html template
<ion-view view-title="Some Title">
    <ion-tabs class="tabs-positive">

        <ion-tab title="Tab 1" ui-sref="some.route.item1">
            <ion-nav-view name="tab1-tab"></ion-nav-view>
        </ion-tab>

        <ion-tab title="Tab 2" ui-sref="some.route.item2">
            <ion-nav-view name="tab2-tab"></ion-nav-view>
        </ion-tab>

    </ion-tabs>
</ion-view>

// Tab1 and/or Tab2 templates
<ion-view view-title="Tab #">
    <ion-content>
        // Your content
    </ion-content>
</ion-view>

You could also include the individual tab markup in the container template using script tags with ng-template.

<script id="templates/tab1.html" type="text/ng-template">
  <ion-view view-title="Tab 1">
    <ion-content class="padding">
      <p>
        // Your content
      </p>
    </ion-content>
  </ion-view>
</script>

这篇关于不显示&QUOT;离子标签&QUOT;在页面细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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