我想在相同的标记行中使用$ index of ng-repeat

时间:2016-10-19 08:10:46

标签: angularjs

我想在同一标记行中使用$ index of ng-repeat

<uib-tabset active="activeameneties" justified="true" class="resp-tabs-list hor_1 classforfont">
    <uib-tab ng-repeat="amenity in prop.all_amenities" class="ami_tabs" index=" " heading="{{amenity.amenity}}" index="{{amenity.id}}"> 
        <div class="resp-tabs-container hor_1" >
            <div class="extMar">
                <br/>
                <div class="row">
                    <div class="col-lg-3 col-md-4 col-sm-6 col-sm-6  col-xs-12" ng-repeat="sub_amenity in amenity.subAmenities">
                        <div class="prop-checkbox">
                            <div class="checkbox checkbox-info checkbox-inline">
                                <input id="Smoking-1" class="checkbox-custom" name="Smoking-1" type="checkbox" value={{sub_amenity.id}}>
                                <label for="Smoking-1" class="checkbox-custom-label">{{sub_amenity.amenity}}</label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </uib-tab>
</uib-tabset>

1 个答案:

答案 0 :(得分:0)

您可以直接与{{$index}}$index一起使用;取决于您提供此值的属性类型。

例如,请查看此codepen