Kendo upload widget disappears with angularjs -
i trying use kendo upload widget, , widget disappears when select file, , file undefined, please me ? use es6 , nodejs. think there problem widget.
<div class="demo-section k-content"> <div> <h4>upload files</h4> <input name="uploadfile" ng-model="vm.files" id="files" type="file" kendo-upload options="vm.options" /> </div> </div> import configglobal '../../config/env/index'; class documentcontroller { /* @nginject */ constructor() { this.name = 'document'; this.options = { select: this.test, async: { saveurl: `${configglobal.default.apiurl}/api/upload/`, removeurl: 'remove', autoupload: true }, upload: this.onupload }; } test() { $('#files').kendoupload(); console.log(this.files); } onupload(e) { $('#files').kendoupload(); console.log(this.files); const xhr = e.xmlhttprequest; if (xhr) { xhr.addeventlistener('readystatechange', () => { if (xhr.readystate === 1) { xhr.withcredentials = 0; console.log(xhr.withcredentials); console.log(xhr); xhr.setrequestheader('access-control-allow-origin', 'http://localhost:3500'); xhr.setrequestheader('withcredentials', 'false'); } }); } } $oninit() { $('#files').kendoupload(); } } export default documentcontroller;
Comments
Post a Comment