ui.bootstrap.contextMenu icon indicating copy to clipboard operation
ui.bootstrap.contextMenu copied to clipboard

fix: update initialization of $ correctly

Open josetaira opened this issue 10 years ago • 3 comments

Fix issue where $ is not initialized properly. Assuming it must always be initialized to angular.element.

josetaira avatar Apr 22 '16 08:04 josetaira

@Templarian if you can quickly take a look at this. The assumption is that $ should be initialized to angular.element. Instead of initializing it later, we pass it as a parameter in the anonymous function call. I also wrapped everything around a function call so that it'd be easier to uglify and concatenate with.

josetaira avatar Apr 22 '16 08:04 josetaira

I did that to keep from wrapping the entire module. You could probably do this with a simple provider...

.value('AngularElement', angular.element) then just inject it ['AngularElement', $]. Didn't test this idea, but I think it should work?

https://github.com/angular-ui/bootstrap/tree/master/src Was looking through to see how they do it here... but they just use angular.element everywhere.

Templarian avatar Apr 22 '16 17:04 Templarian

It might be better to just use angular.element everything. But I prefer to keep the anonymous function call to ensure that projects that merge this code with other codes will work as expected when concatenated and/or uglified.

josetaira avatar Apr 22 '16 17:04 josetaira