We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ab7319 commit e41e445Copy full SHA for e41e445
docs/content/guide/compiler.ngdoc
@@ -190,6 +190,7 @@ This should help give you an idea of what Angular does internally.
190
<pre>
191
var $compile = ...; // injected into your code
192
var scope = ...;
193
+ var parent = ...; // DOM element where the compiled template can be appended
194
195
var html = '<div ng-bind="exp"></div>';
196
@@ -200,7 +201,10 @@ This should help give you an idea of what Angular does internally.
200
201
var linkFn = $compile(template);
202
203
// Step 3: link the compiled template with the scope.
- linkFn(scope);
204
+ var element = linkFn(scope);
205
+
206
+ // Step 4: Append to DOM (optional)
207
+ parent.appendChild(element);
208
</pre>
209
210
### The difference between Compile and Link
0 commit comments