Can I use infinite-scroll with nested objects? Assuming we have 3 departments, and each department has 10 employees. Here is a sample code:
<div infinite-scroll="$ctrl.scroll()">
<div ng-repeat="department in $ctrl.departments">
/* display data here */
<div ng-repeat="employee in $ctrl.employees">
/* display data here */
</div>
</div>
</div>
and this is the the js code:
this.scroll = function() {
console.log("Infinite Scroll Triggered");
for(var i = 0; i < 3; i++) {
console.log("pushing " + this.departments[i].name);
this.departments.push(this.department[i]);
for(var j = 0; j < 10; j++){
console.log("pushing " + this.employee[i].name);
this.employees.push(this.employee[i]);
}
};
I can see on my console that I am pushing to departments and employees, but the page does not refresh. I am also not able to find any examples where ng-scroll is used with nested ng-repeat and nested objects.