【问题标题】:How to integrate a Script into ionic tab content?如何将脚本集成到离子标签内容中?
【发布时间】:2023-03-30 14:42:01
【问题描述】:

我开始使用很棒的 ionic 框架开发应用程序。

当然,在您的帮助下,我已经成功制作出完美运行的条纹标签。现在我在将脚本添加到 ion-view 内容时遇到了问题。

这是我的标签代码:my ionic tabs CODEPEN

这是我想要整合为标签内容的页面:my tab content which i want to ingegrate CODEPEN

我可以这样做吗?

 <ion-view title="Home">
    <div ng-controller="customersCtrl"> 
<div class="list">
   <div ng-repeat="(competitionname, competition) in MatchesByCompetition">
       <div class="item item-divider" >
    {{ competition.name }}
  </div>  
      <a class="item" href="#" align="center" ng-repeat="matche in competition.matches" >
  <img ng-src="http://media-v4.i-dalgo3.com/Sport/Football/Team/Logo/55x55/logo_{{matche.team1.idTeam}}.png" style="width:28px; height:28px; position:absolute; left:10px; top:12px">      
  <h4 style=" display:inline-block; left:60px; position:absolute;"> {{matche.team1.name}}</h4> <h5 style=" display:inline-block;"> {{matche.newstartdate}}</h5>   <h4 style=" display:inline-block; position:absolute; right:60px; ">{{matche.team2.name}}</h4>  
  <img ng-src="http://media-v4.i-dalgo3.com/Sport/Football/Team/Logo/55x55/logo_{{matche.team2.idTeam}}.png" style="width:28px; height:28px; position:absolute; right:10px; top:12px" >      

  </a>   




    </div>

</div>

</div>



  </ion-view>

【问题讨论】:

    标签: javascript ionic-framework


    【解决方案1】:

    你可以做的是,你可以添加另一个tab

    <ion-tab title="list" ui-sref="list"> <ion-nav-view name="list"></ion-nav-view> </ion-tab>

    而不是使用像&lt;script type="text/ng-template" id="home.html"&gt; 这样的内联脚本,您可以告诉ui-router 加载外部页面 在你的路由器中 .state('list', { url: '/list', views: { list: { controler: 'customersCtrl', templateUrl: '<path to your file>list.html' } } }) 事实上,将所有内联脚本移动到单独的文件中是个好主意

    HTH

    【讨论】:

      猜你喜欢
      • 2019-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-24
      • 2015-02-02
      • 1970-01-01
      • 2011-04-09
      相关资源
      最近更新 更多