带ng重复和ng显示索引的Angularjs(可扩展列表)

带ng重复和ng显示索引的Angularjs(可扩展列表),angularjs,Angularjs,我对ng show index有问题。我想更改ng show index。例如: <div class="row" ng-repeat="list1 in Items track by index"> <button ng-click="vm.showLoc($index)"> <div class="row" ng-repeat="list2 in listGroup track by index" ng-show=".."&g

我对ng show index有问题。我想更改ng show index。例如:

 <div class="row" ng-repeat="list1 in Items track by index">
         <button ng-click="vm.showLoc($index)">

       <div class="row" ng-repeat="list2 in listGroup track by index" ng-show="..">
           <div class="row" ng-repeat="listItem in list track by index">
           </div>
        </div>
 </div>
你知道吗

例如:我在项目中有2个项目,所以我有两个按钮。当我单击第一个按钮时,我希望显示属于第一个列表组[0]的值。当我单击第二个按钮时,应该显示属于第二个列表组[1]的值。换句话说,我的列表组也有两个值,但第一个值包含20个项目。第二项包含10项

(函数(){
"严格使用",;
有棱角的
.module('myApp',[])
.controller('myCtrl',myCtrl');
函数myCtrl(){
/*这是真的*/
var vm=这个;
vm.activeIndex=null;
vm.items=[0,1];
vm.listGroup=[
['lg1a'、'lg1b'、'lg1c'],
['lg2a','lg2b','lg2c']
];
vm.showLoc=showLoc;
函数showLoc(i){
vm.activeIndex=i;
}
} 
})();

显示位置
{{list2}

什么页面中的哪个按钮?我都没看到,什么是虚拟机?该函数从何处调用?首先,使用
$index
,然后尝试
ng show=“$index==show”
(或您的控制器名称,例如
$ctrl.show
)当我点击按钮时,它会在之前运行。上面更新的代码应显示第一个列表或第二个列表。您的意思是应显示列表组中的第一个和第二个列表项@BelhandaI在ng repeat中有ng repeat。ListGroup[0]包含一些项。ListGroup[1]包含一些值。我认为人们在理解您的需求方面有很多困难。您可以更新我上面的代码片段,或者使用super cool的小提琴来说明您的确切问题/需求吗
    function showLoc(index){
    vm.show=index;
    }