Guest User

Untitled

a guest
Oct 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <input type="file" ngf-select ng-model="vm.attachment" name="file" accept="application/pdf" ngf-max-size="5MB" ngf-model-invalid="errorFile">
  2.  
  3. <md-button id="uploadButton" class="md-raised md-primary"> Choose Files </md-button>
  4.  
  5. link (scope, element, attrs) {
  6. const input = element.find('#fileInput');
  7. const button = element.find('#uploadButton');
  8.  
  9. if (input.length && button.length) {
  10. button.click((e) => input.click());
  11. }
  12. }
  13.  
  14. <button ngf-select ng-model="picFile" accept="image/*"> Select Picture</button>
  15. File name: {{picFile.name}}
Add Comment
Please, Sign In to add comment