I have my kendo upload widget (via angular) defined as:
I display all the files using initial files option. My objective is to continue to display the list of all files I get from server; once a given file is uploaded.
Because I have the rebind set on $scope.initialFiles; in onSuccess (I also tried onComplete)
where the populate function uses $http service to get data and re-populate $scope.initialFiles...
This works fine with "drag and drop" functionality...but when I upload using the "Select..." button (I've renamed it to "Browse Files").. I get the error:
"Cannot read property 'get' of undefined"
It happens in kendo.min.js (appreciate this is minified code but pasting to give the context). I have marked the line that throws the error.
I need to rebind the widget because after the upload; if I do not do $scope.initialFiles.length = 0;I do not get the current status of files. For example: if the user uploaded text.txt and then in order to overwrite the existing test.txt; reuploaded the same file - although its overwritten on the server - the UI continues to show two instances of text.txt.
How can I best; re-create the upload widget after the upload finishes (note I get the same error with onSuccess and onComplete) so that the list of files shown is only what's in $scope.initialFiles and fix the error I am getting now. The impact of error is that the widget does not get recreated...
Thanks a lot,