This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +19
-4
lines changed
1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 258
258
*
259
259
*
260
260
* #### `templateUrl`
261
- * Same as `template` but the template is loaded from the specified URL. Because
262
- * the template loading is asynchronous the compilation/linking is suspended until the template
263
- * is loaded.
261
+ * This is similar to `template` but the template is loaded from the specified URL, asynchronously.
262
+ *
263
+ * Because template loading is asynchronous the compiler will suspend compilation of directives on that element
264
+ * for later when the template has been resolved. In the meantime it will continue to compile and link
265
+ * sibling and parent elements as though this element had not contained any directives.
266
+ *
267
+ * The compiler does not suspend the entire compilation to wait for templates to be loaded because this
268
+ * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the
269
+ * case when only one deeply nested directive has `templateUrl`.
270
+ *
271
+ * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}
264
272
*
265
273
* You can specify `templateUrl` as a string representing the URL or as a function which takes two
266
274
* arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns
387
395
*
388
396
* #### Post-linking function
389
397
*
390
- * Executed after the child elements are linked. It is safe to do DOM transformation in the post-linking function.
398
+ * Executed after the child elements are linked.
399
+ *
400
+ * Note that child elements that contain `templateUrl` directives will not have been compiled
401
+ * and linked since they are waiting for their template to load asynchronously and their own
402
+ * compilation and linking has been suspended until that occurs.
403
+ *
404
+ * It is safe to do DOM transformation in the post-linking function on elements that are not waiting
405
+ * for their async templates to be resolved.
391
406
*
392
407
* <a name="Attributes"></a>
393
408
* ### Attributes
You can’t perform that action at this time.
0 commit comments