Mam komponent, który mogę animować przy takim wpisie, animacja wpisu działa dobrze. Metoda handleRemoval zostaje wykonana, a emiter zdarzeń filtruje składnik z listy komponentów (za pomocą obserwowalnych). Ale: animacja urlopu nie działa:Angular2 uruchom animację na urlopie i obserwowalny filtr
@Component({
animations: [
trigger(
'enterAnimation', [
transition(':enter', [
style({transform: 'translateY(100%)', opacity: 0}),
animate('500ms', style({transform: 'translateY(0)', opacity: 1}))
]),
transition(':leave', [
style({transform: 'translateY(0)', opacity: 1}),
animate('500ms', style({transform: 'translateY(100%)', opacity: 0}))
])
]
)
],
template: `
<div class="mb1 card text-xs-center rounded" [@enterAnimation]="show">
...
export class ContentPropertyComponent {
show: boolean = false;
constructor(private router: Router) {
this.show = true;
}
handleRemoval(contentProperty: PropertyModel) {
this.show = false;
this.delete.emit(this.contentProperty);
}
}
Każda pomoc mile widziana.
można dostarczyć coś, żeby go zrozumieć? To nie jest zrozumiałe. musimy zobaczyć, w jaki sposób korzystasz z emitera i co dzieje się za sceną? – micronyks
możesz dodać pnkr lub inne [mcve] (https://stackoverflow.com/help/mcve) –
Dzięki za pomoc - w końcu rozwiązałem problem - problem polegał na tym, że usunąłem obiekt contentProperty z pojemnik – rhysclay