我正在尝试使用 Angular js 上传多个文件,但这些值没有存储在模型文件存储中
html代码:
<div ng-app="myApp">
<div ng-repeat="file in filelist">
<label>{{file.name}} </label>
<input type="file" ng-model="filestore[$index]" />
</div>
</div>
<div>
<input type="button" value="submit" ng-click="savefiles(filestore)"/>
</div>
js:
myApp.controller('uploadCtrl', function ($scope,$http) {
//list of file names
$scope.filelist = ["file1", "file2", "file3"];
//save file list
$scope.savefilelist = function(filestore) {
$http({
method: 'POST',
url: '/api/SaveFiles',
data: filestore
});
};
})