File parsing directive for AngularJS
Install with Bower:
$ bower install angular-file-directiveInclude the library:
<scriptsrc="/bower_components/angular-file-directive/angular-file-directive.js"></script>Import it to the angular applicaiton:
angular.module('myApp',['ngFile']);Use it in the view:
<!-- Bind the values to $scope.files --><inputtype="file"
file="files"
accept="image/*"
multiple><!-- Render the selected files directly in the view --><divng-repeat="file in files"><h4>{{ file.name }}</h4><imgalt="{{ file.name }}"
ng-src="data:{{ file.type }};base64,{{ file.body }}"></div>