0
В угольке index.html
я использую компонент для отправки действий и получить файлОтправить файл в контроллер Ember
<script type="text/x-handlebars" id="components/picture-upload">
<input multiple="true" onchange={{action "upload"}}
accept="image/png,image/jpeg,application/pdf"
type="file"
/>
</script>
<script type="text/x-handlebars" id="upload">
{{picture-upload upload='upload'}}
{{outlet}}
</script>
и в app.js
App.UploadController=Ember.Controller.extend({
actions:{
upload:function (event) {
//here to get file
}
}});
App.PictureUploadComponent=Ember.Component.extend({
actions:{
upload(){
//i want to send file but this is not good value
this.sendAction('upload',this);
}
}
});
, но я не знаю, как отправить событие, мне нужно что-то вроде этого answer, после этого я хочу с ajax отправить файл на сервер, но проблема в том, как получить файл!