Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 嵌套ng重复$first和$last?_Javascript_Jquery_Angularjs - Fatal编程技术网

Javascript 嵌套ng重复$first和$last?

Javascript 嵌套ng重复$first和$last?,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我有以下表格 <tbody ng-repeat="attGroup in attributesGroups"> <tr> <td class="vcenter text-right"> &nbsp;&nbsp;<a href="javascript:" ng-click="!$last && updateGroupOrder(attGroup.id,'down')" titl

我有以下表格

<tbody ng-repeat="attGroup in attributesGroups">
    <tr>
        <td class="vcenter text-right">
            &nbsp;&nbsp;<a href="javascript:" ng-click="!$last && updateGroupOrder(attGroup.id,'down')" title="move down"><i class="entypo-down-open-big"></i></a>
            &nbsp;&nbsp;<a href="javascript:" ng-click="!$first && updateGroupOrder(attGroup.id,'up')" title="move up"><i class="entypo-up-open-big"></i></a>                
        </td>
    </tr>
    <tr ng-repeat="att in attGroup.attributes">            
        <td class="vcenter text-right">
            &nbsp;&nbsp;<a href="javascript:" ng-click="!$last && updateAttributeOrder(att.id,'down')" title="move down"><i class="entypo-down-open-big"></i></a>
            &nbsp;&nbsp;<a href="javascript:" ng-click="!$first && updateAttributeOrder(att.id,'up')" title="move up"><i class="entypo-up-open-big"></i></a>

        </td>
    </tr>


您可以看到,我在attributesGroups ng repeat和attributesGroups.attributes ng repeat中都使用$last/$first。现在我的问题是,第二个$last和$first属于attributesGroups或attributesGroups。attributes?

$first/$last
取决于调用它的上下文

<tbody ng-repeat="attGroup in XXX">
    <tr>
        <!--- HERE $first/$last belongs to XXX --->
    </tr>
    <tr ng-repeat="att in YYY">            
        <!--- HERE $first/$last belongs to YYY --->
    </tr>
</tbody>