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事件,通过事件去读取文件。