forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.compile.html
31 lines (29 loc) · 1.02 KB
/
angular.compile.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
<h1>angular.compile</h1>
<fieldset class="workInProgress">
<legend>Work In Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.
</fieldset>
<h2>Description</h2>
<p>Compiles a piece of HTML or DOM into a <a href="#!angular.scope"><code>scope</code></a> object.</p><div ng:non-bindable><pre class="brush: js; html-script: true;">
var scope1 = angular.compile(window.document);
scope1.$init();
var scope2 = angular.compile('<div ng:click="clicked = true">click me</div>');
scope2.$init();
</pre></div>
<h2>Usage</h2>
<tt ng:non-bindable>
angular.compile(element, parentScope);
</tt>
<h3>Parameters</h3>
<ul>
<li><tt>element</tt> –
<tt>{string|DOMElement}</tt>
<tt></tt>
– Element to compile.</li>
<li><tt>parentScope</tt> –
<tt>{Object=}</tt>
<tt></tt>
– Scope to become the parent scope of the newly compiled scope.</li>
</ul>
<h3>Returns</h3>
<tt>{Object}</tt> Compiled scope object.