我尝试了很多次,但仍然无法添加图像。我想制作图片库并使用 angularjs 添加图片以进行无限滚动。如何从本地文件夹而不是任何数据库中添加图像是可能的吗?
<body ng-app="infiniteScroll">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="" class="navbar-brand">Infinite scroll in Angular js</a>
</div>
</div>
</nav>
<div role="main" class="container theme-showcase" ng-controller="scrolling">
<div class="main-wrapper">
<div class="row" infinite-scroll='loadMore()'>
<div class="col-xs-6 col-md-3" ng-repeat='image in images'>
<a class="thumbnail">
<img ng-src="*how to add local images here*" alt="{{image}}">
</a>
</div>
</div>
</div>
</div>
var app = angular.module('infiniteScroll', ['infinite-scroll']);
angular.module('infinite-scroll').value('THROTTLE_MILLISECONDS', 250);
app.controller('scrolling',function($scope, $http){
$scope.images = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
$scope.loadMore = function() {
var last = $scope.images[$scope.images.length - 1];
for(var i = 1; i <= 12; i++) {
$scope.images.push(last + i);
}
};
});