как реализовать прокрутку infine, поскольку данные json - это большой файл. У меня есть немного проблем, как создание бесконечной прокрутки в angularjs из файла JSON, созданного на внешнем сайте. Как заставить бесконечный свиток работать по отношению к внутренней полосе прокрутки контента? ниже мой код
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" href="table.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(window).resize(function() {
if ($(window).width() < 960) {
window.location = "http://www.stackoverflow.com";
}
else {
window.location = "http://www.google.com";
}
});
</script>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body class="body" ng-app="myApp" ng-controller="customersCtrl">
<header class="mainHeader">
<nav>
<ul>
<li class="active"><a href="#">Sokranti Data Analytics</a></li>
</ul>
</nav>
</header>
<div class="mainContent">
<div class="content">
<article class="topcontent">
<content>
<div class="mytable">
<table >
<tr>
<td>eng_rev_type</td>
<td>year_start</td>
<td>year_end</td>
<td>type</td>
<td>amount</td>
</tr>
<tr ng-repeat="x in names | filter:test">
<td>{{ x.eng_rev_type }}</td>
<td>{{ x.year_start }}</td>
<td>{{ x.year_end }}</td>
<td>{{ x.type }}</td>
<td>{{ x.amount }}</td>
</tr>
</table>
</div>
</content>
</article>
</div>
<aside class="top-sidebar">
<article>
<h2>Filter</h2>
<p><input type="text" ng-model="test"></p>
</article>
</aside>
</div>
<footer class="mainFooter">
<p>Copyright © 2015 <a href=""></a></p>
</footer>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("data.json")
.success(function (response) {$scope.names = response.data;});
});
</script>
</body>
</html>
Вы можете создать директиву, которая будет привязываться к событию прокрутки. Затем вы можете увеличить размер прокрутки.