the question is like this: I have three images placed in the html part of the Angular component
<img class="img" [@Esc]='escala' (mouseover)="escalar()" (mouseout)="desescalar()" src="./assets/1.jpg" >
<img class="img" [@Esc]='escala' (mouseover)="escalar()" (mouseout)="desescalar()" src="./assets/2.jpg" >
<img class="img" [@Esc]='escala' (mouseover)="escalar()" (mouseout)="desescalar()" src="./assets/3.jpg" >
The idea is that when you move the mouse over one of these, scale its size to 1.5 and when you return it returns to its scale to 1.
In my TypeScript I do the animation, the problem is that when I move the mouse over the element, all the images scale at once and I would like only one to scale while the others stay the same.
in my Trigger I put this:
trigger('Esc',[
state('escalar',style({
transform: 'scale(1.5)'
})),
state('desescalar',style({
transform: 'scale(1)'
})),
transition('* => *', animate('500ms ease'))
])
and this is activated with the scalar () and de-escalation () methods
escalar(){
this.escala = 'escalar';
}
desescalar(){
this.escala = 'desescalar';
}
but the Trigger does not differentiate between the elements, so I always scale all and I desescala all, in the future those images will be put dynamically so I do not want to have to make a Trigger for each one, is there some way so that you can identify which image is scaled and which is not?
Thank you in advance for your answers :)