So i'm building a chat app, everytime you send a message you will automatically scrolled to the bottom, and i use this code to do that
.html
<div class="chatContent" #scrollMe [scrollTop]="scrollMe.scrollHeight">
.ts
@ViewChild('scrollMe') scrollMe;
this.shouldScroll = this.scrollMe.scrollTop + this.scrollMe.clientHeight ===this.scrollMe.scrollHeight;
if (!this.shouldScroll) {
this.scrollToBottom();
}
scrollToBottom() {
this.scrollMe.scrollTop = this.scrollMe.scrollHeight;
}
and this error appear
i've seen this post Binding scrollTop directly in template gives error but still got that error after i refresh the page