scoll a div to bottom in angular
import {..., AfterViewChecked, ElementRef, ViewChild, OnInit} from 'angular2/core'
@Component({
...
})
export class ChannelComponent implements OnInit, AfterViewChecked {
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
ngOnInit() {
this.scrollToBottom();
}
ngAfterViewChecked() {
this.scrollToBottom();
}
scrollToBottom(): void {
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
}
}
Also in JavaScript:
- expo react native
- angular how to get previous state
- react after deployment givin nginx 404
- jquery table row calculation
- js index sorted
- A fatal JavaScript error has occurred. Should we send an error report
- tinymce menubar hide
- dotenv
- devexpress dxdatagrid custom text field link
- json beautify
- pop-under window before current page
- checking ascii in js
- how to display current date and time in angular
- javascript leave page warning
- quick sort in javascript
- random item from array javascript
- string pop last char js
- how to get value of button that click on it jquery
- js what does var mean
- appendchild element once if element present in js
- summernote mentions ajax
- ScrollController not attached to any scroll views
- generate module with routing in angular
- hide checkbox jquery