Templarian / ui.bootstrap.contextMenu

AngularJS Bootstrap UI Context Menu
MIT License
259 stars 127 forks source link

"ReferenceError: $a is not defined" when opening the contextMenu #10

Closed ElephantRose closed 9 years ago

ElephantRose commented 9 years ago

Hello,

Firstly thanks for your work. This is really easy to use.

I have found and error when opening the contextMenu. with Angular 1.3.8 and jQuery 2.1.3. tested in chrome 42 and IE 11

The error is thrown in the renderContextMenu on :

$a = $('<a>');

Changing it to :

var $a = $('<a>');

solved the issue for me.

I think there is a variable conflict somewhere in one other directives that I'm using. To avoid it I suggest to restrict the $a variable to this scope only (with the var keyword)

Have a good day

Templarian commented 9 years ago

https://github.com/Templarian/ui.bootstrap.contextMenu/commit/84f4ebac794f9ec4f2be3af14aa447bb0c154016

I'll need to publish a new version, but the repo is updated.

ElephantRose commented 9 years ago

great !

Thank you

Templarian commented 9 years ago

This was added in v0.9.2.