1.0.6 • Published 6 years ago

@voxtecnologia/file-upload v1.0.6

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

1. Install Vox Upload globally:

$ npm install --g @voxtecnologia/file-upload

2. Install Vox Upload in your project devDependencies:

$ npm install --save @voxtecnologia/file-upload

3. Setup Module

Import UploadModule into your app.module.

import { UploadModule } from '@voxtecnologia/file-upload';

@NgModule({
  ...
  imports: [
    UploadModule
  ],
})

4 . Setup Component

Import UploadService into your app.component

import { Component } from '@angular/core';
import { UploadService } from '@voxtecnologia/file-upload';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
    public title = 'app';
    
    constructor(
      private uploadService: UploadService,
    ) {
      
    public sendFiles() {
      this.uploadService.sendFile();
    }
}

5 . Setup Angular JSON

  • add bootstrap dependency
  • add font-awesome

angular.json or .angular-cli.json

  "styles": [
      "node_modules/bootstrap/dist/css/bootstrap.min.css",
      "../node_modules/font-awesome/css/font-awesome.css",
      "src/styles.css"
    ],

6. Setup on View

<app-vox-upload
    maxSize="2"
    [url]="getUrl"
    [fileExt]="getExtesao()"
    [anexosRequeridos]="anexos()">
</app-vox-upload>

7. Usage and options

NameTypeExemplesOptionalOptions Default
fileExtStringjpg, pdf, txt, iconYespdf, png, jpeg, jpg, csv, doc, docx
maxSizenumber10Yes2 MB
urlStringhttp://localhost:3000/api-fileNoNo
anexosRequeridosArrayconst anexos = [{}]NoNo
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago