zeeshanhyder/angular-tag-cloud

event handling via handlers: doesn't work

Closed this issue · 2 comments

Hi,
Out of the box, parsing handlers: in words JSON object would not work and crashes with
handlersp is undefined.
I was able to get event handling working by changing these:

Looking at ng-tag-cloud.js:
// Bind handlers to words (though not really useful in this version!) if (!!word.handlers) { for (var prop in word.handlers) { if (word.handlers.hasOwnProperty(prop) && typeof word.handlers[prop] === 'function') { word_span.addEventListener(prop,word.handlersp[prop]); } } }
changing this line:
word_span.addEventListener(prop,word.handlersp[prop]);
to:
word_span.addEventListener(prop,word.handlers[prop]);

Are you able to include these changes in the build?

Hi. Thanks for notifying. Can you do a PR? I will review and merge. Thanks.