I have an animation in an angular application
@Component({
selector: 'app-portfolio',
templateUrl: 'portfolio.page.html',
styleUrls: ['portfolio.page.scss'],
animations: [
trigger('slideInOut', [
transition(':enter', [
style({transform: 'translateY(-100%)'}),
animate('200ms ease-in', style({transform: 'translateY(0%)'}))
]),
transition(':leave', [
animate('200ms ease-in', style({transform: 'translateY(-100%)'}))
])
])
]
})
However there are two elements in the same position that use it, and they can't be on the screen at the same time. So if I select to show the one element, then the other element will automatically hide. The problem is I just want the element to animate out if the other element isnt being animated in. Is there a way to only show the animation if a condition has been met? Something like this?
<ion-item color="primary" (element2open === false)=[@slideInOut] *ngIf="openElement1" lines="none">
</ion-item>
<ion-item color="primary" (element1open === false)=[@slideInOut] *ngIf="openElement2" lines="none">
</ion-item>