如何使用 Angular js 上传图片?或者如何在输入类型文件中使用/模拟 ng-model?

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

我有一个包含姓名、电子邮件...和用户图像的网络应用程序注册表格,我通过 rest api 和 $http 在一个名为 userData 的对象中发送数据,我如何添加这个对象的文件/图像?如何使用 angular 模型或将文件绑定到范围变量?

提前致谢。

我使用 ng-file-upload: https://github.com/danialfarid/ng-file-upload

它处理图片效果很好,支持通过拖放、多个文件等方式上传