RyanMullins / angular-hammer

Hammer.js v2 support for AngularJS
http://ryanmullins.github.io/angular-hammer/
MIT License
188 stars 55 forks source link

add user specific parameter, used in callback #44

Open neophob opened 9 years ago

neophob commented 9 years ago

Hi Ryan

Thanks for your library. I needed to add a custom parameter to each directive call. Example:

<div hm-payload="CUSTOM PARAMETER" hm-press="onHammer" hm-pressup="onHammer" hm-recognizer-options='{"preventGhosts":true,"time":500}'></div>

then the scope function looks like this:

$scope.onHammer = function(event, payload) {
    console.log('I got an event: ', event.type);
    console.log('payload: '+payload);
}
RyanMullins commented 9 years ago

I recenty merged #55. Can you take a look at this stuff again and see if those changes solve your issue?