forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.element.html
59 lines (52 loc) · 2.87 KB
/
angular.element.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<h1>angular.element</h1>
<div class="angular-element"><h2>Description</h2>
<div class="description"><p>Wraps a raw DOM element or HTML string as a <a href="http://jquery.com">jQuery</a> element.
<code>angular.element</code> can be either an alias for <a href="http://api.jquery.com/jQuery/">jQuery</a> function, if
jQuery is available, or a function that wraps the element or string in Angular's jQuery lite
implementation (commonly referred to as jqLite).</p>
<p>Real jQuery always takes precedence over jqLite, provided it was loaded before <code>DOMContentLoaded</code>
event fired.</p>
<p>jqLite is a tiny, API-compatible subset of jQuery that allows
Angular to manipulate the DOM. jqLite implements only the most commonly needed functionality
within a very small footprint, so only a subset of the jQuery API - methods, arguments and
invocation styles - are supported.</p>
<p>Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never
raw DOM references.</p>
<h4>Angular's jQuery lite provides the following methods:</h4>
<ul>
<li><a href="http://api.jquery.com/addClass/">addClass()</a></li>
<li><a href="http://api.jquery.com/after/">after()</a></li>
<li><a href="http://api.jquery.com/append/">append()</a></li>
<li><a href="http://api.jquery.com/attr/">attr()</a></li>
<li><a href="http://api.jquery.com/bind/">bind()</a></li>
<li><a href="http://api.jquery.com/children/">children()</a></li>
<li><a href="http://api.jquery.com/clone/">clone()</a></li>
<li><a href="http://api.jquery.com/css/">css()</a></li>
<li><a href="http://api.jquery.com/data/">data()</a></li>
<li><a href="http://api.jquery.com/hasClass/">hasClass()</a></li>
<li><a href="http://api.jquery.com/parent/">parent()</a></li>
<li><a href="http://api.jquery.com/remove/">remove()</a></li>
<li><a href="http://api.jquery.com/removeAttr/">removeAttr()</a></li>
<li><a href="http://api.jquery.com/removeClass/">removeClass()</a></li>
<li><a href="http://api.jquery.com/removeData/">removeData()</a></li>
<li><a href="http://api.jquery.com/replaceWith/">replaceWith()</a></li>
<li><a href="http://api.jquery.com/text/">text()</a></li>
<li><a href="http://api.jquery.com/trigger/">trigger()</a></li>
<li><a href="http://api.jquery.com/eq/">eq()</a></li>
</ul>
<h4>In addtion to the above, Angular privides an additional method to both jQuery and jQuery lite:</h4>
<ul>
<li><code>scope()</code> - retrieves the current Angular scope of the element.</li>
</ul></div>
<h2>Usage</h2>
<div class="usage"><div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.element(element);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">element – {string|DOMElement} – </code>
<p>HTML string or DOMElement to be wrapped into jQuery.</p></li>
</ul>
<h3>Returns</h3>
<div class="returns"><code ng:non-bindable="">{Object}</code>
– <p>jQuery object.</p></div>
</div>
</div>