visjs/angular-visjs

Uncaught TypeError: Cannot read property 'apply' of undefined when using event listener

amar0k opened this issue · 3 comments

Not sure if it is because of the latest vis.js update or not but i cannot seem to use any even listeners , i just get a callback error and this.

vis.js:9967 Uncaught TypeError: Cannot read property 'apply' of undefined
at Timeline.Emitter.emit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:9967:21)
at CustomTime._onDrag (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:24481:23)
at Array.propagatedHandler (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:11189:29)
at Object.emit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:13659:26)
at emit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:12679:28)
at PanRecognizer.emit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:12684:15)
at PanRecognizer.emit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:12969:28)
at PanRecognizer.tryEmit (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:12707:27)
at PanRecognizer.recognize (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:12754:20)
at Object.recognize (http://192.168.0.107:3000/public/vendor/vis/dist/vis.js:13519:30)

Any help would be appreciated.

Fixed by moving $cope.events to bottom of controller.

So, is this a bug in the directive? If so, do you want to provide a PR?

Not a bug Chris , my mistake the directive is fine. It's great this is still being maintained ... i have a couple of questions maybe you can help me with?