mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(devtools): use safe operation to update the overlay
This commit is contained in:
parent
a93cfdca81
commit
b85d48c7d2
1 changed files with 6 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { Type } from '@angular/core';
|
||||
|
||||
let overlay: any;
|
||||
let overlayContent: any;
|
||||
let overlayContent: HTMLElement;
|
||||
|
||||
declare const ng: any;
|
||||
|
||||
|
|
@ -120,7 +120,11 @@ function showOverlay(
|
|||
overlay.style.top = ~~top + 'px';
|
||||
overlay.style.left = ~~left + 'px';
|
||||
|
||||
overlayContent.innerHTML = '';
|
||||
while (overlayContent.children.length) {
|
||||
const { children } = overlayContent;
|
||||
overlayContent.removeChild(children[children.length - 1]);
|
||||
}
|
||||
|
||||
content.forEach((child) => overlayContent.appendChild(child));
|
||||
|
||||
document.body.appendChild(overlay);
|
||||
|
|
|
|||
Loading…
Reference in a new issue