I am using angular animations and have 2 triggers but only the first trigger works, even when switched around, I've tried to discover why but can't figure it out. My last thought is that maybe because one of the triggers is a child element of another one of the other trigger.
HTML:
<div class="description" [@changeDivSize]=currentState>
<!-- <div *ngIf="visible"> -->
<p *ngFor="let service of services | slice:0:3; let i=index" [@slideyP]="currentSlide"> {{service.description}} </p> <!--[@slideyP]=currentSlide-->
<!-- </div> -->
TS:
animations: [
trigger('changeDivSize', [
state('initial', style({
backgroundColor: 'green',
height: '0',
overflow: 'hidden'
})),
state('final', style({
backgroundColor: 'red',
height: '100px'
})),
state('slide', style({
backgroundColor: 'blue',
height: '100px'
})),
transition('* <=> *', animate('500ms ease-in')),
]),
trigger('slideyP', [
state('slideOne', style({
transform: 'translateX(0%)'
})),
state('slideTwo', style({
transform: 'translateX(-100%)'
})),
state('slideThree', style({
transform: 'translateX(-200%)'
})),
transition('* <=> *', animate('500ms ease-in')),
])
]
Thanks