I'm looping through an array, when all fileRead deferred are resolved, 'done' is logged.
$.when.apply(null, $.each(files, function(index, file){
return self.fileRead.read(file).done(function(fileB64){
self.fileShow(file, fileB64, fileTemplate);
});
})).done(function() {
console.log('done');
})
The problem is, I only wish done to be logged once the fileShow method has returned.
Does this fileShow method also need to implement deferred. Or can it just return?
How can I modify the loop so console.log('done') is ran once all fileShow methods have been executed?