angular2中如何将返回值塞入input为file类型中

clipboard.png

clipboard.png

请问我在修改页中读取的值如何显示在input为file类型中。用[ngModel]接收值控制台就报错了。。应该是不接收一个string类型的值。。请问问有人知道怎么处理这个问题。。
ORIGINAL EXCEPTION: InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

阅读 3.1k
1 个回答

接受ngModelChange事件,通过事件去读取文件。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进