Improve this doc  View Source

angular.element

  1. - function in module ng

Wraps a raw DOM element or HTML string as a jQuery 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."

jqLite is a tiny, API-compatible subset of jQuery that allows Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most commonly needed functionality with the goal of having a very small footprint.

To use jQuery, simply load it before DOMContentLoaded event fired.

Note: all element references in Angular are always wrapped with jQuery or jqLite; they are never raw DOM references.

Angular's jqLite

jqLite provides only the following jQuery methods:

jQuery/jqLite Extras

Angular also provides the following additional methods and events to both jQuery and jqLite:

Events

Methods

Usage

angular.element(element);

Arguments

Param Type Details
element stringDOMElement

HTML string or DOMElement to be wrapped into jQuery.

Returns

Object

jQuery object.