flow`比任何东西都好.
我想使用ng-flow
in 发送一个输入文本和文件Angular js
请帮帮我们......
我目前正在使用ng-flow执行文件上传.看来,选择文件的默认操作是立即上传.我想覆盖它,以便选择文件并仅在按钮单击时上传.也许我误读了文档,但到目前为止我有以下内容:
<div flow-init="{target: '/upload'}"
flow-files-submitted="$flow.upload()"
flow-file-success="$file.msg = $message">
<input type="file" flow-btn/>
Input OR Other element as upload button
<span class="btn" flow-btn>Upload File</span>
<table>
<tr ng-repeat="file in $flow.files">
<td>{{$index+1}}</td>
<td>{{file.name}}</td>
<td>{{file.msg}}</td>
</tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
这似乎工作,我可以看到网络请求出去.我在点击时找到了flow.js上传文件,并尝试按照建议的答案,但$flow
在相应的功能中未定义.
那么,如何使用ng-flow以编程方式上传文件?