Angular 2 scroll event getting height is null.
[sample]: https://plnkr.co/edit/RZSQkd0nqolYv3NBvArG?p=preview
Angular 2 scroll event getting height is null.
[sample]: https://plnkr.co/edit/RZSQkd0nqolYv3NBvArG?p=preview
Seems what you want is
onScroll(){
console.log('clientHeight: ' + this._el.clientHeight);
console.log('offsetHeight: ' + this._el.offsetHeight);
}
See also Get div height with plain JavaScript
getAttribute()
reads attributes. Attributes are visible in the DOM. clientHeight
is a property.
See also Properties and Attributes in HTML