0
ここでは、ng-repeatのインクリメントごとにインクリメントするページ番号を付けたいのですが、2番目のng-repeatインデックスは常にゼロですが、最初のng-repeatは$ parentを通してうまく動作します$ indexこれをどのように解決できますか? ここでのコードサンプルです:
<div ng-repeat="chapter in plan.chapters" class="export-page" >
<div ng-repeat="section in chapter.sections track by section.id" class="export-page" ng-init="sectionindex = $index">
<div class="header">
<br>
<h2 class="headerTitle">
<b>{{$root.selectedCompany.name + ' | ' + chapter.subject}}</b>
</h2>
</div>
<div class="content">
<h1><b>{{chapter.subject}}</b></h1>
<h2 class="chapter" >{{section.subject}}</h2>
<br>
<p ng-if="section.content_type === 'text'">
<div ng-bind-html="section.content.text"></div>
</p>
<p ng-if="section.content_type === 'table'">
<numeric-table model="section.content"
disable-editing="true"
hide-input-controls="true">
</numeric-table>
</p>
<p ng-if="section.content_type === 'aggregated-table'">
<aggregated-table model="section.selectedTables">
</aggregated-table>
</p>
<p ng-if="section.content_type === 'text-table'">
<free-text-table model="section.content"
disable-editing="true"
hide-input-controls="true">
</free-text-table>
</p>
<p ng-if="section.content_type === 'chart'">
<multi-chart model="section.content"
tables="section.selectedTables"
>
</numeric-table>
</p>
</div>
<div class="footer col-xs-12">
<div class="txt col-xs-11">copyright [email protected] {{$root.selectedCompany.name}}</div>
<div class="pp col-xs-1 ">Page{{sectionindex}} </div>
</div>
</div>
</div>
どのように質問に関連するコードの大きなブロック? ng-repeatはなく、$ indexはありません。あなたの質問を明確にし、関連コードを掲示し、正確にそれが生産したアウトプットとあなたが望むアウトプットを説明してください。 –
コピー貼り付けの問題について申し訳ありません – mohamed