Mousedown interval event handler directive.
Bower
bower install angular-on-hold
index.html
<script src="angular.js"></script>
<!--other modules-->
<script src="{{repositoryRoot}}/angular-on-hold.js"></script>
<!--other modules-->
<script src="app/main.js"></script>
main.js
var app = angular.module("myApp", ["kzHold"]);
#Usage main.js
app.run(['$rootScope', function($rootScope){
//...
$rootScope.someFunction = function(){
console.log("triggered click");
};
//...
}])
template.html
<ANY kz-hold="someFunction" kz-hold-frequency="180">click me</ANY>
#Attributes
- kz-hold - required, specifies the function called every time a hold event is triggered
- kz-hold-frequency - optional, specifies the amount of times kz-hold function is triggered per second. 180 by default.