How can I display a text files contents in a textarea?
问题 I am trying to create a file upload component, and display the text file contents in a textarea in the browser for editing before processing. My inputs looks like this <input type="file" process-file/> <textarea id="file-text" ng-model="fileContent"> </textarea> I have a directive that correctly reads the file contents app.directive('processFile', [function () { return { link: function (scope, element, attrs) { element.on('change', function (evt) { var files = evt.target.files; var reader =