In my Angular view, I'm using an expression for a form action. Mysteriously, it's not being evaluated and is instead making an HTTP request for http://127.0.0.1:8000/{{ apiUrl }} instead of whatever apiUrl is set to.
apiUrl is being set by the following code: $scope.apiUrl = config.APIURLBase + '/api/upload';, which looks like it should be working fine.
Any ideas?
<h1>Upload new File</h1>
<form action="{{ apiUrl }}" method="post" enctype="multipart/form-data" id="upload-form" class="dropzone" ng-dropzone dropzone="dropzone" dropzone-config="dropzoneConfig">
<div class="dz-message">
Drop files here or click to upload
</div>
<div class="fallback">
<input type="file" name="files" multiple />
</div>
</form>
I ran across something similar and doing the following fixed it for me.
$scope.api = config.APIURLBase;
And in your form
<form action="{{ api + '/api/upload' }}" method="post" enctype="multipart/form-data" id="upload-form" class="dropzone" ng-dropzone dropzone="dropzone" dropzone-config="dropzoneConfig">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With