Created
June 6, 2016 19:16
-
-
Save natasv/886f62cc62c37c835556957a3d248c2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!file) { | |
return $q.reject(false); | |
} | |
return $q(function (resolve, reject) { | |
var reader = new FileReader(); | |
reader.onloadend = function (response) { | |
var src = response.target.result; | |
var imgPromise = srcToDataURI(src); | |
return resolve(src); | |
}; | |
reader.readAsDataURL(file); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment