Angularでアニメーションを開始した場合、終了する前にどのように停止できますか?終了する前にアニメーションを停止する方法は?
たとえば、ユーザーが何かをクリックしたときにアニメーションがある場合など、アニメーションを停止する必要があります。そして、アニメーションが終了する前に再度クリックすると、そのアニメーションを停止して再起動します。
例えば、角度のドキュメントがthis animationを持っている:だから
animations: [
trigger('heroState', [
state('inactive', style({
backgroundColor: '#eee',
transform: 'scale(1)'
})),
state('active', style({
backgroundColor: '#cfd8dc',
transform: 'scale(1.1)'
})),
transition('inactive => active', animate('100ms ease-in')),
transition('active => inactive', animate('100ms ease-out'))
])
]
アニメーションがトリガされた場合、それが完了する前に、どのように私はそれを停止することができますか?