I'm creating a SPA, with ng-router, and i need to use infinite scroll on one site inside ng-view, but I get a bit confused when ngInfiniteScroll hadn't fired. So i tried to do it on myself without any luck.
For simplicity :
index.html
<html ng-app="myApp">
...
<div ng-view id="whyDoYouWontScroll"> </div>
pageToLoad.html
<section ng-controller="someLazyCtrl" ng-init="initLazyLoad()">
<div class="classWithSomeTremendousHeight"></div>
<section>
someLazyCtrl.js
angular.module('myApp').controller('someLazyCtrl',function($scope){
$scope.initLazyLoad = function(){
document.getElementById('whyDoYouWontScroll').addEventListener('scroll',function(){
console.log('It's working!');
});
}
}
Event listener is added correctly, ng-view section have enough height to be scrolled, but... event is not firing.
I was looking around here, and found this topic but using ng-include is not a solution for me.