Skip to content

Commit

Permalink
fix: extending internal uploaderx class
Browse files Browse the repository at this point in the history
  • Loading branch information
kukhariev committed May 21, 2019
1 parent c4b9b9f commit 496acff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/app/service-way/service-way.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Component, OnDestroy, OnInit } from '@angular/core';

import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

import { UploadxOptions, UploadState, UploadxService, UploadItem } from '../../uploadx';
import { environment } from '../../environments/environment';
import { Ufile } from '../ufile';
import { UploadState, UploadxOptions, UploadxService } from '../../uploadx';
import { AuthService, tokenGetter } from '../auth.service';
import { Ufile } from '../ufile';
import { UploaderExt } from './uploader-ext.class';

@Component({
selector: 'app-service-way',
Expand All @@ -18,7 +17,8 @@ export class ServiceWayComponent implements OnDestroy, OnInit {
options: UploadxOptions = {
endpoint: `${environment.api}/upload`,
token: tokenGetter,
chunkSize: 2_097_152
chunkSize: 2_097_152,
uploaderClass: UploaderExt
};
private ngUnsubscribe: Subject<any> = new Subject();

Expand Down
7 changes: 7 additions & 0 deletions src/app/service-way/uploader-ext.class.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { UploaderX } from '../../uploadx';

export class UploaderExt extends UploaderX {
onCancel() {
console.log('Canceled');
}
}
16 changes: 4 additions & 12 deletions src/uploadx/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
export * from './interfaces';
export * from './uploader';
export * from './uploaderx';
export * from './uploadx.module';

export {
UploaderOptions,
UploadItem,
UploadState,
UploadxControlEvent,
UploadxOptions
} from './interfaces';

export { UploadxService } from './uploadx.service';

export { Uploader } from './uploader';
export * from './uploadx.service';

0 comments on commit 496acff

Please sign in to comment.