Browse Source

Update loading.directive.ts

pull/23577/head
Mahmut Gundogdu 6 months ago
committed by GitHub
parent
commit
0b2f2d47ad
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  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

@ -88,7 +88,7 @@ export class LoadingDirective implements OnInit, OnDestroy {
ngOnInit() {
if (!this.targetElement) {
const { offsetHeight, offsetWidth } = this.elRef.nativeElement;
if (!offsetHeight && !offsetWidth && this.elRef.nativeElement.children.length) {
if (!offsetHeight && !offsetWidth && this.elRef.nativeElement.children?.length) {
this.targetElement = this.elRef.nativeElement.children[0] as HTMLElement;
} else {
this.targetElement = this.elRef.nativeElement;

Loading…
Cancel
Save