Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Broadcast saveAs() result #39

Open
aaronmallen opened this issue Jan 26, 2017 · 0 comments
Open

[Feature Request] Broadcast saveAs() result #39

aaronmallen opened this issue Jan 26, 2017 · 0 comments

Comments

@aaronmallen
Copy link

aaronmallen commented Jan 26, 2017

I'd like to see some form of broadcast, or perhaps callback firing depending on FileSaver.saveAs completion.

i.e.

// with callback support.
function resultFN(e) {
  console.log('File Saved!');
  return e;
}

var data = new Blob([text], { type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(data, 'text.txt', resultFN);

// or on broadcast
$rootScope.$on('FileSaverSuccess', function (e, opts) {
   console.log('File Saved!');
   return e;
});

// or on promise resolution
var data = new Blob([text], { type: 'text/plain;charset=utf-8' });
FileSaver.saveAs(data, 'text.txt').then(function (result) {
  console.log('File Saved!');
  return result;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant