I have a file controrl, button and select control. Like below,
<div class="form-group">
<h4><b>File Upload</b></h4>
<label for="file">File</label>
<input type="file" id="file" ng-model="message.file" class="form-control"/>
<input type="button" value="Add" id="addFile" ng-click="addFiles(1)"/>
</div>
<div class="form-group">
<label for="fileList">These are your selected files</label>
<br/>
<select name="files" ng-model="message.files" size="4" class="form-control"></select>
</div>
Once the files are browsed, on button click the files local path along with filename should be displayed in select control. If i select another file 2nd time that also should be displayed in select control. That is 2 files name.
Am new to angularJS, so wondering how to do that, can anyone throw light on this.
Below is my angular Controller,
messageBoardApp.controller('messageBoardController',
function messageBoardController($scope,messageBoardService) {
//$scope.submitForm = function () {
// debugger;
// alert("Controller");
// messageBoardService.SaveMessage($scope.message);
//};
$scope.addFiles=function(){
}
});
This functionality is completely client side, that is in user machine. User can also remove any one of the selected files by clicking remove button.
ng-options.