How to use the @iplab/ngx-file-upload.FileUploadControl function in @iplab/ngx-file-upload

To help you get started, we’ve selected a few @iplab/ngx-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 pIvan / file-upload / src / example-app / app.component.ts View on Github external
templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewInit {

  public readonly fileUploadControl = new FileUploadControl(FileUploadValidators.fileSize(80000));

  public readonly fileUploadWithTemplate = new FileUploadControl();

  public readonly filesControl = new FormControl(null, FileUploadValidators.accept(['video/*', 'image/*', '.mp3']));

  public readonly demoForm = new FormGroup({
    files: this.filesControl
  });

  public readonly customFileUploadControl = new FileUploadControl().setListVisibility(false);

  public animation: boolean = false;
  public uploadedFiles = [];
  public isDisabled: boolean = false;
  public acceptFiles: string = 'image/*';

  constructor(private elRef: ElementRef) {
  }

  public ngAfterViewInit(): void {
    this.elRef.nativeElement.querySelectorAll('.prettify')
      .forEach(( el: HTMLElement ) => el.innerHTML = prettify.prettyPrintOne(el.innerHTML));
  }

  public toggleStatus(): void {
    this.filesControl.disabled ? this.filesControl.enable() : this.filesControl.disable();

@iplab/ngx-file-upload

> Angular module used for file upload.

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis