我正在为我的项目使用http://valor-software.com/ng2-bootstrap/#/carousel。
我可以实现它,但幻灯片1始终处于活动状态。我不确定如何从slide1中删除活动类。
唯一的问题是我无法将活动幻灯片的值设置为特定值。WhenI设置活动输入,我得到的幻灯片是为第一张幻灯片设置的值。我无法删除幻灯片1的活动类。
<carousel *ngIf="planList" (activeSlideChange)="onSlideChange($event)" [interval]="false">
<slide *ngFor="let plan of planList" [active]="plan.active">
<oe-plan-details [planDetailsSummary]="plan"></oe-plan-details>
</slide>
</carousel>在本例中,我将plan-3的plan.active设置为true。我看到了计划-1和计划-3。也就是说,2个旋转木马
发布于 2017-03-08 17:57:59
您应该使用双向数据绑定来设置活动索引
<carousel [(activeSlide)]="activeIndex">
<slide *ngFor="let i of items">
<img [src]="i.image" class="img-responsive" alt="some image">
</slide>
</carousel>https://stackoverflow.com/questions/42668011
复制相似问题