From c2927ba94c2ff89f92fc0c6cfca5f7f49ddb9745 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 14 Oct 2024 10:59:25 -0700 Subject: [PATCH] docs(elements): Add limitations section (#58194) PR Close #58194 --- adev/src/content/guide/elements.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adev/src/content/guide/elements.md b/adev/src/content/guide/elements.md index 373dab820db..849c93981ad 100644 --- a/adev/src/content/guide/elements.md +++ b/adev/src/content/guide/elements.md @@ -157,3 +157,10 @@ document.createElement('my-dialog') //--> NgElement & WithProperties<{co document.querySelector('my-other-element') //--> NgElement & WithProperties<{foo: 'bar'}> (custom element) + +## Limitations + +Care should be taken when destroying and then re-attaching custom elements created with `@angular/elements` due to issues with the [disconnect()](https://github.com/angular/angular/issues/38778) callback. Cases where you may run into this issue are: + +- Rendering a component in an `ng-if` or `ng-repeat` in `AngularJs` +- Manually detaching and re-attaching an element to the DOM