I have an ngStyle on my button. - >
<ion-button *ngIf="showBtn" (click)="tap()" [ngStyle]="getRandomPos()" fill="outline">
When i click it this happenes - >
getRandomPos()
{
return { marginLeft: Math.floor(Math.random() * 83) + 1 + 'vw', marginTop: Math.floor(Math.random() * 145) + 1 + 'vw' }
}
So It sets a random position for my button. But when i click my button, it's repositioning twice.
(The tap function is just playing a sound and changing a variable)
Please Help!