【发布时间】:2017-02-20 16:35:39
【问题描述】:
我有一个使用事件发射器移除的子组件,我想在移除时添加动画。我的想法是从通配符状态动画到无效:
@Component({
selector: 'content-attendee',
styleUrls: ['content-attendee.component.scss'],
template: `
<div class="px1 item">
testing 123
<a class="btn-remove ion-close-circled md fnt--mid-gray" (click)="handleRemoval()"></a>
</div>
</div>
`,
animations: [
trigger('item', [
transition('* => void', [
animate(100, style({ transform: 'scale3d(0, 0, 0)' }))
])
])
]
})
export class ContentAttendeeComponent {
@Input() contentAttendee: AttendeeModel;
@Output()
delete: EventEmitter<AttendeeModel> = new EventEmitter<AttendeeModel>();
handleRemoval(contentAttendee: AttendeeModel) {
this.delete.emit(this.contentAttendee);
}
}
但是移除动画没有运行,非常感谢任何帮助。
【问题讨论】:
标签: angular angular2-template web-animations