0
All right? I’m creating a button that when clicked it displays an image, and if clicked again it goes back to the old image, at the angle, currently I’m only able to catch the first action, I can’t go back to the first image.
HTML
<div (click)="clique()">
<img src="{{ imagem }}" />
</div>
TS
imagem: string;
clique(): void {
if(this.imagem) {
this.imagem = 'imagem1.jpg';
} else {
this.imagem = 'imagem2.jpg';
}
}
Thank you very much friend, it worked perfectly, and thank you for the explanation so I could realize my mistake
– Joao Passos