【问题标题】:toggle list items on and of with angular and ionic lists使用角度和离子列表打开和关闭列表项
【发布时间】:2015-08-21 16:58:08
【问题描述】:

我有一个很好的排序列表,显示按汽车品牌排序的汽车类型。即

Bmw
____
318
745

Porsche
____
911
965

我正在尝试弄清楚如何打开和关闭汽车品牌下的项目,以便您获得例如

BMW
___
Porsche
____
911
965

但我卡住了。我创建了一个 css 类 hiderecommendation (display:none) 和 showrwcommendation (display:block)。现在我正在尝试 ng-click 类,但是我被卡住了。有人看到我做错了吗?

 <ion-content  class="has-subheader">
    <ion-refresher on-refresh="doRefresh()">
    </ion-refresher>
    <ion-list>
    <div class="category" ng-repeat="(key, value) in recommendation | filter: query | groupBy : 'textID' ">
      <ion-item ng-click="toggleRecommendation(item)" class="item item-text-wrap"> 
      <span>{{key}}</span>
      </ion-item>  

      <ion-item ng-repeat="item in value" ng-class="item.recommendation ? 'showrecommendation' : 'hiderecommendation'">
        <div class="item item-text-wrap">
        <span>{{item.Recommendation}}</span> 
        </div>
     </ion-item>

  </ion-list>
  </ion-content>

【问题讨论】:

    标签: angularjs css ionic-framework


    【解决方案1】:

    当有一个有效的 3rd 方 Ionic 插件时,不要伤脑筋。

    它被称为离子树列表,您可以随意使用它,找到它here

    【讨论】:

    • 感谢您的推荐!很高兴看到这被认为是有用的,但仍有一些挑战悬垂,作为项目的“拖放”功能。非常欢迎 PR!再次感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-11
    相关资源
    最近更新 更多