我嘗試了很多次,但仍無法添加圖像。我想製作圖像庫並使用angularjs添加無限滾動圖像。我怎樣才能從本地文件夾添加圖像不是從任何數據庫是可能的?我如何從本地文件夾添加圖像,使無限滾動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);
}
};
});
從本地文件夾中選擇的文件使用[](https://開頭developer.mozilla.org/en-US/docs/Web/HTML/Element/input#File_inputs)。 – georgeawg
好的謝謝你的答覆,但我怎麼可以在我的情況下管理?困惑!! – Zeeshan