Search code examples
javascriptangularjsfile-uploadinputangular-ngmodel

how to upload images with Angular js ? or how to use / simulate ng-model in input type file?


I have a form wich contain name, email... and user's image for a web app registration, i send data via a rest api with $http in a objet called userData, how ca i add to this objet the file / image ? how to use angular model or bind the file to a scope variable ?

Thanx in advance.


Solution

  • I use ng-file-upload: https://github.com/danialfarid/ng-file-upload

    It works well with images and supports uploading by drag and drop, multiple files etc.