https://github.com/danialfarid/angular-file-uploadを使用しようとしていますが、ファイルにアクセスできないようです
私のHTML
<img
src = "{{ userPhotoUrl }}"
alt = ""
class = "img-circle img-responsive"
accept = "image/*"
data-multiple = "false"
ng-file-select = "onFileSelect($file)"
>
私のコフェスクリプト:
$scope.onFileSelect = ($file) ->
console.log $file
$scope.upload = $upload.upload
url : '/api/upload/photo'
file : $file
method : 'POST'
.progress (e) ->
console.log 'percent' + parseInt 100.0 * e.loaded / e.total
.success (data, status, headers, config) ->
console.log data, status, headers, config
私はちょうどから取得undefined
しますconsole.log($file)
何が間違っている可能性がありますか?同じロジックを入れてみました
<input type="file" ng-file-select="onFileSelect($file)">
しかし、私は同じ結果を得ます