angular-editor
angular-editor copied to clipboard
feat: add shadow dom support, fixes #321
When using angular-editor under a shadow dom encapsulated component, it was throwing errors as it tried to find some elements by their id's using the global document api:

This pull request tries to solve it by changing the way we access those elements using Angular's ElementRef instead of document. It also adds a new page on the angular-editor-app project to showcase the use of angular-editor under a shadow dom encapsulated component.
Test are passing:

Codecov Report
Merging #479 (c2cfe4b) into master (40431f4) will increase coverage by
0.24%. The diff coverage is50.00%.
@@ Coverage Diff @@
## master #479 +/- ##
==========================================
+ Coverage 20.66% 20.91% +0.24%
==========================================
Files 8 8
Lines 479 483 +4
Branches 103 103
==========================================
+ Hits 99 101 +2
- Misses 377 379 +2
Partials 3 3
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...editor/src/lib/angular-editor-toolbar.component.ts | 18.25% <42.85%> (+0.51%) |
:arrow_up: |
| ...angular-editor/src/lib/angular-editor.component.ts | 17.44% <60.00%> (+0.38%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 40431f4...c2cfe4b. Read the comment docs.
The same issue is happening to me. Does anyone have a solution?