I have a random function that I call when the user press a button. I would like to keep running that function till the user releases the button.
I found the mouse-down directive but it seems to not work for mobile.
I also tried the code below using the ng-touchstart lib.
HTML
<div id="vs">
<span ng-touchmove="randomize($event)" ng-controller="myCtrl">VS</span>
</div>
Controller
.controller('myCtrl', function($scope) {
$scope.randomize = function($event) {
// trigger this function again and again till user releases the button
};
})
With ng-touchmove
the event is not even triggered.
Is there any way to achieve what I'm looking for ?