-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
FileReader.onLoad/onLoadEnd event argument has no target.result property #4163
FileReader.onLoad/onLoadEnd event argument has no target.result property #4163
Comments
looks related to #299. |
PRs welcomed. here is some infromation on contributing lib.d.ts changes: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes |
This is used in other cases also such as IndexedDB onsuccess event. |
Should be covered by microsoft/TypeScript-DOM-lib-generator#207 |
My solution, until this all fixed up, has been just adding a union to the Event callback:
It's gross, but does the trick. The better way would probably be something like this as it is way more complete and abstracts out the types, rather than inlining them. |
Instead of using For example,
|
This does not work when running the app in Electron 5.5.1 |
Hello, I have the some problem, but only when my angular project is build for production ... what could be the issue ? |
I have the same problem after I have done ng build --prod. Something happens during the conversion from 'ts' to 'js'... |
|
This is how I solved it, in production: let FileReader: new() => FileReader = ((window as any).FileReader as any).__zone_symbol__OriginalDelegate Based on this StackOverflow post: |
How about this:
|
using this with arrow function will not give the expected result.
|
Trying to retrieve the result of a read file/blob via the event passed into the reader's onload/onloadend method results in a type error (Property 'result' does not exist on type 'EventTarget').
This is valid JavaScript, which is failing type checking because the EventTarget interface does not have a result property.
Examples:
Workaround: Retrieve the result from the reader object (FileReader.result)
The text was updated successfully, but these errors were encountered: