我正在开发一个页面,我需要显示一些ng-repeat包含频道信息的框(使用)以及它将在何处显示(哪些是城市).
我面临的问题是当我重复第二个问题时ng-repeat:
<table class="table table-condensed" ng-init="nitsCh = [objsCh[$index].nit]">
Run Code Online (Sandbox Code Playgroud)
这应该得到第一个ng-repeat的$ index并创建一个新的数组,其中显示了通道的位置.它确实如此.但是,当我使用此数组应用第二个ng-repeat时,它无法正常工作.
说我的html看起来像这样(PS:我需要使用索引值而不是objCh.name因为我将这些框放入列中)
<div class="box box-solid box-default" ng-repeat="(indexO, objCh) in objsCh track by indexO" ng-if="indexO%4==0 && indexO<=10">
<div class="box-header">
<div class="pull-left">
<img src="dist/img/channels/{{ objsCh[indexO].pic }}" data-toggle="tooltip" title="" data-original-title="Alterar logo do canal">
<h3 class="box-title">{{ objsCh[(indexO)].name }}</h3>
</div>
<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-toggle="tooltip" title="" data-original-title="Adicionar ou Remover NIT"><i class="fa fa-plus"></i></button>
</div>
</div>
<div class="box-body">
<table class="table table-condensed" ng-init="nitsCh = [objsCh[indexO].nit]">
<tbody>
<tr>
<th style="width: 10px">#</th>
<th>Nit</th> …Run Code Online (Sandbox Code Playgroud)