Angular: AnimationPlayer的onStart和onDone事件仅发出一次

创建于 2018-10-21  ·  1评论  ·  资料来源: angular/angular

我正在提交...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

当前行为

AnimationPlayer onStartonDone事件仅发出一次,必须创建一个新播放器才能使事件重新起作用

预期行为

AnimationPlayer onStartonDone事件应该在第一次播放后再次工作

使用指令最小化问题重现

  this.animationBuilder.build([
      query(
        '.child-element',
        [
          stagger(100, [useAnimation(animation)])
        ]
      )
    ]);
    this.player = builder.create(this.el.nativeElement);
    this.player.onStart(() => {
      console.log('animation onStart');
    });
    this.player.onDone(() => {
      console.log('animation onDone');
    });

https://stackblitz.com/edit/angular-bynhgg?file=src/app/app.component.ts

改变行为的动机/用例是什么?

能够重用播放器

环境


Angular version: 7.0.0
<!-- Check whether this is still an issue in the most recent Angular version -->

Browser:
- [x ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: 8  <!-- run `node --version` -->
- Platform:  Windows

Others:
<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->

可能与#26095有关

P4 animations high bufix

最有用的评论

这确实很烦人,因为它违反了AnimationPlayer的可重用性目的。

Angular 8.0问题在这里转载: https :

>所有评论

这确实很烦人,因为它违反了AnimationPlayer的可重用性目的。

Angular 8.0问题在这里转载: https :

此页面是否有帮助?
0 / 5 - 0 等级