zotherstupidguy
zotherstupidguy

Reputation: 3024

Angular-UI jQuery Passthrough vs angular.element()

What is the provided functionality of Angular-UI Jquery Passthrough and angular.element()?

Are they interchangeable? does jQuery passthrough any additional options over angular.element()?

Any good examples out there that might demonstrate the power of each in an ng-app?

Upvotes: 0

Views: 625

Answers (1)

ProLoser
ProLoser

Reputation: 4616

You are confusing 2 unrelated pieces of code.

Passthru is just a simple wrapper that enables you to call any jQuery method on a DOM element without creating a new directive.

angular.element() is a javascript method that returns a DOM element. If you injected jQuery first then angular.element() === jQuery() ==== $()

Passthru does not do anything special, and angular.element() isn't needed because a $element is already provided by the linking function.

Upvotes: 1

Related Questions