SHARE
TWEET

Untitled

a guest Sep 15th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export function readFileAsDataURL(file: Blob): Observable<string> {
  2.   return new Observable(observable => {
  3.     const fileReader = new FileReader();
  4.  
  5.     fileReader.onload = () => {
  6.       observable.next(fileReader.result as string);
  7.       observable.complete();
  8.     };
  9.     fileReader.readAsDataURL(file);
  10.   });
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top