使用动态数据在ng-click上过滤ng-repeat

时间:2016-01-21 10:44:24

标签: angularjs filter ng-repeat

我的HTML

<span ng-repeat="types in type" ng-click="itemClicked($index)">
    <i class="mdi {{types.logo}} s24" ng-class="{ 'active': $index == selectedIndex }">
    <md-tooltip>{{types.name}}</md-tooltip>
    </i>
</span>
<md-list-item class="md-3-line" ng-repeat="assets in data">
   <img ng-src="{{assets.image}}" class="md-avatar" alt="{{item.who}}" />
   <div class="md-list-item-text" layout="column">
   <h3>{{assets.name}} {{assets.code}}</h3>
   <h4>{{assets.location}}, {{assets.price}}, $1000</h4>
   <p>{{assets.weeksbooked.weeks}}</p>
   </div>
   <md-divider ></md-divider>
</md-list-item>

如果我点击i元素我只想用点击的类型显示结果意味着我的数据集(资产)中有一个字段'type'。                                            在此先感谢: - )

0 个答案:

没有答案