Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 |
Tags
- Eclipse
- varags
- scrollView
- Android
- Web Service
- 컬럼명
- SpringSource Tool Suite
- Apache Lucene
- C#
- 안드로이드
- 웹뷰
- WebView
- 웹 서비스
- Bootstrap
- MANTIS
- html
- MS-SQL
- 자바스크립트
- asp.net
- javascript
- Maven
- STS
- Java
- jsp
- 이클립스
- Redirect
- decompiler
- MSsql
- 자바
- TextBox
Archives
- Today
- Total
bboks.net™
Ionic production 빌드 후 FileReader.onload 먹통 현상 본문
Ionic production 빌드 후 잘되던 FileReader의 onload가 안됨
구글링 해보니 나와 같은 현상을 겪은 사람들 발견
아래와 같이 처리
기존코드
const file = event.target.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
console.log(reader.result);
};
수정버전
const file = event.target.files[0];
let FileReader: new() => FileReader = ((window as any).FileReader as any).__zone_symbol__OriginalDelegate;
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => {
console.log(reader.result);
};
[참고]
FileReader.onLoad/onLoadEnd event argument has no target.result property