How to use @swimlane/ng2-file-upload - 2 common examples

To help you get started, we’ve selected a few @swimlane/ng2-file-upload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimlane / ngx-ui / projects / swimlane / ngx-ui / src / lib / components / button / file-button.component.ts View on Github external
this.ngZone.run(() => {
      if (!this.uploader && !this.options) {
        throw new Error('You must pass either an uploader instance or options.');
      }

      // if options were passed, init a new uploader
      if (!this.uploader && this.options) {
        this.uploader = new FileUploader(this.options);
      }

      // always remove after upload for this case
      this.uploader.options.removeAfterUpload = true;

      this.uploader.onAfterAddingFile = this.onAfterAddingFile.bind(this);
      this.uploader.onBeforeUploadItem = this.onBeforeUploadItem.bind(this);
      this.uploader.onProgressAll = this.onProgressAll.bind(this);
      this.uploader.onSuccessItem = this.onSuccessItem.bind(this);
      this.uploader.onErrorItem = this.onErrorItem.bind(this);
    });
  }
github swimlane / ngx-ui / projects / swimlane / ngx-ui / src / lib / components / button / file-button.component.spec.ts View on Github external
beforeEach(() => {
    fixture = TestBed.createComponent(FileButtonComponent);
    component = fixture.componentInstance;
    component.uploader = new FileUploader({ });
    component.disabled = false;
    component.multiple = false;
    fixture.detectChanges();
  });

@swimlane/ng2-file-upload

This is a fork of https://github.com/valor-software/ng2-file-upload that is compatible with Ivy and angular 9. It is not under maintenance, so please do not submit pull requests.

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis

Popular @swimlane/ng2-file-upload functions