Angular 2根据元素类确定状态

时间:2016-10-04 14:43:34

标签: angular animation transition angular-animations angular-transitions

我在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"。有没有办法,改变基于阶级的状态?

0 个答案:

没有答案