mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
docs($compile): add note about recursive compilation in templates
Closes #3079 Closes #6869
This commit is contained in:
@@ -282,6 +282,16 @@
|
||||
* apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration
|
||||
* should be done in a linking function rather than in a compile function.
|
||||
* </div>
|
||||
|
||||
* <div class="alert alert-warning">
|
||||
* **Note:** The compile function cannot handle directives that recursively use themselves in their
|
||||
* own templates or compile functions. Compiling these directives results in an infinite loop and a
|
||||
* stack overflow errors.
|
||||
*
|
||||
* This can be avoided by manually using $compile in the postLink function to imperatively compile
|
||||
* a directive's template instead of relying on automatic template compilation via `template` or
|
||||
* `templateUrl` declaration or manual compilation inside the compile function.
|
||||
* </div>
|
||||
*
|
||||
* <div class="alert alert-error">
|
||||
* **Note:** The `transclude` function that is passed to the compile function is deprecated, as it
|
||||
|
||||
Reference in New Issue
Block a user