aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content
diff options
context:
space:
mode:
authorMarc Lipovsky2013-11-21 21:57:53 -0800
committerPete Bacon Darwin2013-11-27 22:41:10 +0000
commite41e445b513f97b4c42b51f3bf67835f28d65b48 (patch)
treeb62e889010f188509a896193a39eaac96db72aad /docs/content
parent7ab73190b79da069be2fa02f8c1bb29e40c9bae9 (diff)
downloadangular.js-e41e445b513f97b4c42b51f3bf67835f28d65b48.tar.bz2
docs(guide/compiler): add fourth step on appending the compiled template to the DOM
Closes #5087
Diffstat (limited to 'docs/content')
-rw-r--r--docs/content/guide/compiler.ngdoc6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/content/guide/compiler.ngdoc b/docs/content/guide/compiler.ngdoc
index ffc6ea43..4440ace6 100644
--- a/docs/content/guide/compiler.ngdoc
+++ b/docs/content/guide/compiler.ngdoc
@@ -190,6 +190,7 @@ This should help give you an idea of what Angular does internally.
<pre>
var $compile = ...; // injected into your code
var scope = ...;
+ var parent = ...; // DOM element where the compiled template can be appended
var html = '<div ng-bind="exp"></div>';
@@ -200,7 +201,10 @@ This should help give you an idea of what Angular does internally.
var linkFn = $compile(template);
// Step 3: link the compiled template with the scope.
- linkFn(scope);
+ var element = linkFn(scope);
+
+ // Step 4: Append to DOM (optional)
+ parent.appendChild(element);
</pre>
### The difference between Compile and Link