angular2-multiselect-dropdown icon indicating copy to clipboard operation
angular2-multiselect-dropdown copied to clipboard

Angular 9 + Angular Universal

Open SandeepC14 opened this issue 5 years ago • 0 comments

I am implementing Angular Universal. The code is compiling right but when I run the code, I see this error in the server side - main.js

ERROR ReferenceError: document is not defined at AngularMultiSelect.calculateDropdownDirection

Main.js Function calculateDropdownDirection() { /** @type {?} / let shouldOpenTowardsTop = this.settings.position == 'top'; if (this.settings.autoPosition) { /* @type {?} / const dropdownHeight = this.dropdownListElem.nativeElement.clientHeight; /* @type {?} / const viewportHeight = document.documentElement.clientHeight; /* @type {?} / const selectedListBounds = this.selectedListElem.nativeElement.getBoundingClientRect(); /* @type {?} / const spaceOnTop = selectedListBounds.top; /* @type {?} / const spaceOnBottom = viewportHeight - selectedListBounds.top; if (spaceOnBottom < spaceOnTop && dropdownHeight < spaceOnTop) { this.openTowardsTop(true); } else { this.openTowardsTop(false); } // Keep preference if there is not enough space on either the top or bottom / if (spaceOnTop || spaceOnBottom) { if (shouldOpenTowardsTop) { shouldOpenTowardsTop = spaceOnTop; } else { shouldOpenTowardsTop = !spaceOnBottom; } } */ } }

How can we ignore this function from getting.

SandeepC14 avatar Apr 23 '20 15:04 SandeepC14