Ian McNally

'defaultPrevented' of undefined

May 07, 2014

Stuck on this today, with Angular:

Cannot read property 'defaultPrevented' of undefined

Turns out someone had an errant jasmine spy on $rootScope.$broadcast. Just put .andCallThrough() on the spy, and bam! Errors gone.

Ian McNally

Hey, I'm Ian. I build websites and write about what I learn as I go. Follow me on Twitter.