user1995781
user1995781

Reputation: 19463

Should use angular.element or $?

angular.element and $ basically refer to the same thing. In angularjs, which one is best practice of doing and have better performance?

Upvotes: 0

Views: 748

Answers (1)

Andi N. Dirgantara
Andi N. Dirgantara

Reputation: 2051

If you ask about best practice, it should be use angular.element instead. Because Angular use jQLite by default in the angular.element object, but if you include jQuery, it will become full jQuery, not jQLite. So it provide more safety to our code.

Here is the official reference.

Upvotes: 1

Related Questions