When trying to load files previously uploaded from the server the following error is produced.
// Load existing files:
$.ajax({
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0]
}).done(function (result) {
$(this).fileupload('option', 'done').call(this, $.Event('done'), {result: files});
});
//Exception
jquery.fileupload-angular.js:130 Uncaught TypeError: Cannot read property '$apply' of undefined
at done (jquery.fileupload-angular.js:130)
at <anonymous>:2:47
The following snippet is in the FileUploadController which puts the $scope into the file data.
$element.fileupload(angular.extend(
{scope: $scope},
fileUpload.defaults
)).on('fileuploadadd', function (e, data) {
data.scope = $scope;