I try to load a script via angular-cli to sync two divs. When page is loaded for the first time, the script is working fine. Aftter that I change the route via Navigation. When going back to the first page, the script is not working anymore.
Angular CLI:
"scripts": [
....
"assets/scripts/scrollsync.js"
]
scrollsync.js:
$(function() {
$('#column-item-container').on('scroll', function () {
$('#row-lead-container').scrollTop($(this).scrollTop());
});
$('#column-item-container').on('scroll', function () {
$('#column-lead-container').scrollLeft($(this).scrollLeft());
});
});
I try to figure out if the script is still present to set a timeout with 1000ms sending some to console, that works fine. I looks like the binding is not working anymore. Some advice to fix this problem? Thank you!