Angular directive for DOM removals fails

Not reproducible Issue #13685032


Sep 11, 2017
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

The following code runs fine in other browsers but fails in Edge when used on a component tag.

import { Directive, ElementRef } from '@angular/core’;

// remove the host of a component and render just the inner component html
selector: '[remove-host]'
export class RemoveHostDirective {
constructor(private el: ElementRef) {

// wait for the component to render completely
ngOnInit() {
    let nativeElement: HTMLElement = this.el.nativeElement,
        parentElement: HTMLElement = nativeElement.parentElement;
    // move all children out of the element
    while (nativeElement.firstChild) {
        parentElement.insertBefore(nativeElement.firstChild, nativeElement);
    // remove the empty element(the host)


You can find more details about what this is about here


0 attachments

    Comments and activity

    • This was actually a result of failed Modernizr load. So you can close this issue.

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Status to “Not reproducible”

    • Hello,

      Thank you for sharing your problem and solution. Please reopen this case if you have new information about this specific issue for us to investigate.

      Best Wishes,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in