Reputation: 159
I need to convert some jQuery code to Angular 2 and am having some trouble figuring out how to get the height of the document.
The jQuery code I have used is
$(document).height();
How would I achieve this in Angular 2?
Thanks
Upvotes: 3
Views: 9344
Reputation: 41893
Using document.height
doesn't work in angular 2 aswell as in the console.
console.log(window.outerHeight);
console.log(window.innerHeight);
console.log(screen.height);
Upvotes: 4
Reputation: 657158
What about just using document.height
without jQuery?
document.height
https://developer.mozilla.org/en-US/docs/Web/API/Document/height
This worked in the Plunker
document.documentElement.clientHeight
Upvotes: 1