I want to randomly change div position in angular

  angular

I want to change div posisition randomly in anguar

I was try everthing but it can not works

  styleUrls: ['./slot-game-home.component.css'],
  animations:[
    trigger('btncaseout',[
      state('move', style({
        transform: 'translateX(300px) ',
      })),
      transition('state=>move',animate('3000ms ease')),
    ])
  ]

})
<div type="button" #username id='caseout' (click)="onClick()" [@btncaseout]="position" (mousemove)="changePosition()">Case OUT</div>


It moves only one directions

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.