【发布时间】:2017-01-24 21:12:05
【问题描述】:
让我重新表述我的问题,我有一个问题,删除上传的文件,所以我按照建议对我的代码进行了一些修改,但它仍然不起作用,此外还有覆盖我上传的文件的问题,所以每次我上传东西都会覆盖以前的文件,我希望能够上传很多并删除它们,谢谢
<form class="htmlForm">
<label for="id_payment_proof">{% trans "Payment proof:" %}</label>
<div class="full-size">
<div class="input-control full-size file" data-role="input">
<input id="id_payment_proof" type="file" file-model="payment_proof"/>
<button class="button"><span class="mif-folder"></span></button>
</div>
</div>
<div ng-if="client_invoice.payment_proof_filename">
<a ng-href="{{ client_invoice.payment_proof }}"
ng-bind="client_invoice.payment_proof_filename"
target="_blank"></a>
<button class="button" ng_click="clearInvoice()">
<span class="mif-bin"></span>
</button>
</div>
{% endverbatim %}
</form>
控制器:
editInvoiceHandler = (event, row) ->
$scope.payment_proof = undefined
$scope.htmlFormEl.reset()
$scope.row = row
$scope.client_invoice = row.data()
hasChanges = false
$scope.editMode = true
$scope.$digest()
$scope.clearInvoice() = () ->
$scope.payment_proof = 0
【问题讨论】:
标签: javascript angularjs coffeescript