Hi I've got follow div:
angular.module("myApp", ['ngTouch']).controller("myController", function($scope) {
$scope.longClick = function() {
console.log('I was clicked long');
}
});
.longClick {
width: 200px;
height: 20px;
line-height: 20px;
color: white;
font-family: Arial;
background-color: grey;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-touch.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myController" class="longClick" ng-click="longClick()">Click me long...</div>
I would like to detect on the tablet, when the div was clicked/touched with a long press and print then the text in the console. I found some answers for such questions but everything I tried didn't work. Any ideas? Thanks.