refactor: add undefined control to loading.directive

pull/3545/head
mehmet-erim 6 years ago
parent 30622bb8f8
commit d27ddb398b

@ -54,7 +54,7 @@ export class LoadingDirective implements OnInit, OnDestroy {
if (newValue && !this.rootNode) {
this.rootNode = (this.componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0];
this.targetElement.appendChild(this.rootNode);
} else {
} else if (this.rootNode) {
this.renderer.removeChild(this.rootNode.parentElement, this.rootNode);
this.rootNode = null;
}

Loading…
Cancel
Save