Difference between element.find("elm") and element[0].querySelector("elm")

Hello :smiley:

Whatā€™s the best way to find an element inside a directive?

element.find(ā€œelmā€)?
element[0].querySelector(ā€œelmā€)?

Iā€™ve seen in the ionic lib and sometimes they use element.find, but most of the times they use element[0].querySelector.

I always use .find, but i wantā€™ to know the difference, Iā€™ve tried to search for it, but there are several opinions about the two ways, but none could clarify my doubt.

So if someone could explain to me the difference between the both, i would be glad.

EDITED:
I think i got it!

element.find in jqlite only allows looking for tag names, if you want to find idā€™s or classes, you will have to use element.querySelector, this without jQuery lib. Correct me if iā€™m wrong.

Still is best to use element.find when looking for tag names instead querySelector?
Why?

Regards,
pcagica.

element.find would be betterā€¦ because angular restricted the selectors to minify dom-manipulations.
In a perfect world you do only dom-manipulation on the element you set on your directive.