<!doctype html>
<html ng-app="plunker" >
<head>
<meta charset="utf-8">
<title>AngularJS Plunker</title>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script>
<script src="app.js"></script>
</head>
<body>
<div ng-controller="MainCtrl">
<input type="file" multiple name="files" filelist-bind/>
<br>
<ul><li ng-repeat="file in files">{{ file.name }}</li></ul>
</div>
</body>
</html>
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope) {
$scope.files = [];
});
app.directive("filelistBind", function() {
return function( scope, elm, attrs ) {
elm.bind("change", function( evt ) {
//console.log( evt );
scope.$apply(function( scope ) {
scope[ attrs.name ] = evt.target.files;
});
});
};
});
/* Put your css in here */