我有一个使用事件发射器删除的子组件,我想在它的删除上添加一个动画。我的想法是从通配符状态动画到无效:
@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);
}
}
但是删除动画没有运行,任何帮助都非常感谢。