我在Angular 2中有旋转木马,我想添加过渡到它。我做了Tour of Heroes教程,所以我在app.component.ts:
<carousel [interval]="5000" [noWrap]="noLoopSlides">
<hero *ngFor="let hero of heroes; let index=index" [active]="hero.active" [inactive]="hero.inactive" class="item fill">
<img [src]="hero.image" style="margin:auto;">
<div class="carousel-caption">
<h3 style="background-color: transparent;color: white;">Slide {{index + 1}}</h3>
</div>
</hero>
</carousel>
并且英雄元素类的时间间隔从item fill carousel-item active
更改为item fill carousel-item inactive
,并且仅显示active
。我想从active
转换为inactive
,但基于Documentation,我需要使用触发器[@heroState]="hero.state"
。有没有办法,改变基于阶级的状态?