I have a plunker here - https://plnkr.co/edit/N6UuQJbOfdtmQygpr6cL?p=preview
I have a simple table in an Angular app, the table scrolls left to right
I'm using jQuery to capture when the page scrolls - I'm outputting a simple console log.
I'm doing this for a simple sticky header on the table that isnt in the example.
I also need to capture the when the table scrolls left to right.
This doesn;'t work and I dont get an console log.
Is there a way to capture the left/right scroll in the table with jQuery
import {Component, OnInit} from '@angular/core';
declare let $: any;
@Component({
selector: 'my-app',
templateUrl: './src/app.html'
})
export class AppComponent implements OnInit{
constructor() {
}
ngOnInit(){
this.scrollWindow();
this.scrollTable();
}
scrollWindow(){
$(function(){
$(window).on('scroll', function(){
console.log('window scroll')
})
})
}
scrollTable(){
$(function(){
$(table).on('scroll mousewheel', function(){
console.log('table scroll')
})
})
}
}