Adi Prasetyo
Adi Prasetyo

Reputation: 1042

What is the main differences between DOM element and angular element

That's the question, but specifically my problem is:

  1. I can't execute getComputedStyle it keep yelling the first parameter is not type of element.
  2. I can't access raw DOM property.
  3. Often i can't see raw DOM property in web console.

I care more about my understanding rather than getting my code running.

Upvotes: 1

Views: 6268

Answers (1)

SivaTeja
SivaTeja

Reputation: 388

Angular Element: If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or jqLite.

https://docs.angularjs.org/api/ng/function/angular.element

DOM element: Document object model. The DOM is the way Javascript sees its containing pages' data. It is an object that includes how the HTML/XHTML/XML is formatted, as well as the browser state.

A DOM element is something like a DIV, HTML, BODY element on a page. You can add classes to all and add style with respect to added classes using CSS, or interact with them using JS. look at this answer What is DOM element?

Upvotes: 6

Related Questions