How to use the @iplab/ngx-file-upload.FileUploadValidators.fileSize 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
import { Component, AfterViewInit, ElementRef } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import * as prettify from 'google-code-prettify/bin/prettify.min.js';

import { FileUploadControl, FileUploadValidators } from '@iplab/ngx-file-upload';


@Component({
  selector: 'app-root',
  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/*';

@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