アップロードしたファイルを削除する際に問題が発生しましたので、提案したようにコードを修正しましたが、それでも問題はありません。アップロードしたファイルを上書きするので、私はそれだけで私は多くをアップロードし、それらを削除できるようにしたい以前のファイルを上書きして、何かをアップロードするたびに、感謝anglejsを使用して入力フィールドをクリアします
<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>
のcontroler:で
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
「clearInvoice」に入るのにこの必要性を待っていますか? – PetarP
@PetarP 'clearInvoice'は' payment_proof'のすべての要素を削除する関数ですか? –
それはすべきですが、動作していません – PetarP