I have a function in angular directive that gets triggered on watch. How do i test the timeout based scrolling activity of the function scroll
since its not in scope?
scope.$watch('elementId', function(value) {
//How do i test scroll function contents?
scroll(element, value);
});
function scroll (pE, element) {
console.log('Here');
$timeout(function afterTimeout () {
var scrollTo = $('#' + element);
var container = $(pE);
container.animate({scrollTop : scrollTo[0].offsetTop - container[0].offsetTop - 10}, 'slow');
}, 250);
}
The detailed code is here http://jsfiddle.net/QGmCF/68/