ネストされたオブジェクトで無限スクロールを使用できますか? 3 つの部門があり、各部門には 10 人の従業員がいるとします。サンプルコードは次のとおりです。
<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>
これはjsコードです:
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]);
}
};
部門や従業員にプッシュしていることをコンソールで確認できますが、ページが更新されません。また、ネストされた ng-repeat およびネストされたオブジェクトで ng-scroll が使用されている例を見つけることもできません。