2

我在我的应用程序中使用 ng-flow,有没有办法限制上传文件的数量?

代码示例:

<div class="thumbnail" ng-show="$flow.files.length">
  <img flow-img="$flow.files[0]" />
</div>
<div>
  <a href="#" class="btn" ng-hide="$flow.files.length" flow-btn flow-attrs="{accept:'image/*'}">Select image</a>
  <a href="#" class="btn" ng-show="$flow.files.length" flow-btn flow-attrs="{accept:'image/*'}">Change</a>
  <a href="#" class="btn btn-danger" ng-show="$flow.files.length"
     ng-click="$flow.cancel()">
    Remove
  </a>
</div>
4

1 回答 1

0

属性 flow-file-added 需要一个布尔值。你可以把你所有的条件放在那里。$flow.files.length 返回您已经添加的文件数

例如:

<div flow-init flow-files-submitted="$flow.upload()" flow-file-added="$flow.files.length<3"></div>
于 2015-09-03T16:17:20.390 回答