Angular2 Animation onDone callback

末鹿安然 提交于 2019-12-11 05:08:00

问题


Anyone know how to catch onDone callback for new animation system in angular2? There is an animation - and I want to do some stuff onDone... I saw in sources of angular2 this method at AnimationPlayer interface, but nothing has been exposed to users...

With best regards! Very appreciate yours answers!


回答1:


With the forthcoming RC6 release this will be supported via (@animation.done): https://github.com/angular/angular/commit/45e8e73670b96387fc109921fad299742d3f7cbf




回答2:


Have you tried

import {AnimationPlayer} from '@angular/core';
constructor(animationPlayer:AnimationPlayer) {
  animationPlayer.onDone(() => {
    console.log('animation done');
  });
}


来源:https://stackoverflow.com/questions/38108993/angular2-animation-ondone-callback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!