Skip to content

Instantly share code, notes, and snippets.

@visnup
Created December 19, 2014 22:05
Show Gist options
  • Select an option

  • Save visnup/189857189d5a910923cb to your computer and use it in GitHub Desktop.

Select an option

Save visnup/189857189d5a910923cb to your computer and use it in GitHub Desktop.
simple test case for closed issue in fastclick https://github.com/ftlabs/fastclick/issues/23, but not fixed in angular-touch
<html ng-app='test'>
<head>
<title>touch test</title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<style>
button {
width: 100%;
-webkit-tap-highlight-color: transparent;
}
</style>
</head>
<body>
<form ng-controller="touch">
<p>{{count}}</p>
<button ng-click="up()">count</button>
</form>
<script src="https://code.angularjs.org/1.3.4/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.4/angular-touch.min.js"></script>
<script>
angular
.module('test', ['ngTouch'])
.controller('touch', function($scope) {
$scope.count = 0;
$scope.up = function() {
if (confirm("Do you really want to count?"))
$scope.count++;
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment