<div *ngFor="let post of posts ;let i = index " >
<div class="tabs_main">
<ul class="tabs_ul">
<li class="tabs_li active" (click)="explore_tab_one(post.id)"> Questions </li>
<li class="tabs_li" (click)="explore_tab_two(post.id)"> Opinions</li>
</ul>
<div class="tab_content active">
<div class="row">
<div class="col-sm-12">
<h3> Tab 1 </h3>
</div>
</div>
</div>
<div class="tab_content">
<div class="row">
<div class="col-sm-12">
<h3> Tab 2 </h3>
</div>
</div>
</div>
</div>
</div>
如何在* ngfor循环中创建多个标签?
我的期望是点击意见,显示标签2并切换活动的类,只有第一个循环