Skip to content

Commit

Permalink
fix: IE11 support
Browse files Browse the repository at this point in the history
Closes #4
Thanks @exasky!
  • Loading branch information
kukhariev committed May 17, 2018
1 parent 129bd02 commit bbba1f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
34 changes: 14 additions & 20 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,42 @@
*/

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';


/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';


/**
* Required to support Web Animations `@angular/platform-browser/animations`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.



/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.



/***************************************************************************************************
* APPLICATION IMPORTS
*/
7 changes: 3 additions & 4 deletions src/uploadx/src/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export class Uploader implements UploaderOptions {
return this.resume();
}
const xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.open(this.method, this.options.url, true);
xhr.responseType = 'json';
if (!!this.options.withCredentials) {
xhr.withCredentials = true;
}
Expand Down Expand Up @@ -149,10 +149,10 @@ export class Uploader implements UploaderOptions {
*/
private resume(): void {
const xhr: XMLHttpRequest = XHRFactory.getInstance();
xhr.open('PUT', this.url, true);
if (xhr.responseType !== 'json') {
xhr.responseType = 'json';
}
xhr.open('PUT', this.url, true);
if (!!this.options.withCredentials) {
xhr.withCredentials = true;
}
Expand Down Expand Up @@ -210,11 +210,10 @@ export class Uploader implements UploaderOptions {
end = end > this.size ? this.size : end;
const chunk: Blob = this.file.slice(start, end);
const xhr: XMLHttpRequest = XHRFactory.getInstance();
xhr.open('PUT', this.url, true);
if (xhr.responseType !== 'json') {
xhr.responseType = 'json';
}

xhr.open('PUT', this.url, true);
if (!!this.options.withCredentials) {
xhr.withCredentials = true;
}
Expand Down

0 comments on commit bbba1f9

Please sign in to comment.