Browse Source

refactor: add undefined control to loading.directive

pull/3545/head
mehmet-erim 7 years ago
parent
commit
d27ddb398b
  1. 2
      npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts

2
npm/ng-packs/packages/theme-shared/src/lib/directives/loading.directive.ts

@ -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