forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.compile.html
22 lines (21 loc) · 1.05 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
<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>
<div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.compile(element, parentScope);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">element – {string|DOMElement} – </code>
Element to compile.</li>
<li><code ng:non-bindable="">parentScope<i>(optional)</i> – {Object} – </code>
Scope to become the parent scope of the newly compiled scope.</li>
</ul>
<h3>Returns</h3>
<code ng:non-bindable="">Object</code>
– Compiled scope object.