0.3.6 • Published 1 year ago

mat-upload v0.3.6

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

This project made by ZELLKON.


Github

NPM Package

Installation

npm i mat-upload

Implement

Import

import { MatUploadModule } from 'mat-upload';

Add Module

@NgModule({
  imports: [
    ...
    MatUploadModule
  ],
  declarations: [	
    AppComponent,
   ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use library in your component

Last Update: Angular 15 remove fxLayout, change preview image to image icon

  <div>
    <mat-upload 
    [options]="yourOption"
    formControlName="file"></mat-upload>
  </div>

Selector: mat-upload

Properties

NameDescription
Latest updatecombine @Input() options: MatUploadOptions
label: stringThe label for upload card.
description: stringDescription for drag and drop.
serverUrl: string or undefinedEnvironment for case image Url return Test/sample.png this will returun serverUrl + Test/sample.png.
apiUrl: stringEnvironment api server for upload file.
typeUpload: stringsingle or multiple or dragNdrop
accessToken: string or undefinedYour bearer token.
location: string or undefinedYour location upload.
accept: stringRead more https://www.w3schools.com/tags/att_input_accept.asp . Example: image/png,image/jpg
valueKey: stringThis's key of response object. Example: {error: 0, message: 'success'} =>keyUrl = "message" => formControl.value = ['success']
messageUploadError: stringThis is error upload message.
messageExtensionError: stringThis is error extension message.
snackBarClass: stringDefined class for SnackBar. Example: snackBarClass="errorUpload" and add .errorUpload{background: red; color: white;} into your styles.scss. Update css for Angular 15 example: .mat-mdc-snack-bar-container {&.error-snackBar {--mdc-snackbar-container-color: #2196f3; --mat-mdc-snack-bar-button-color: #fff; --mdc-snackbar-supporting-text-color: #fff; }}
requestParam = 'file'Defined param for request.
errorKey = 'm'Defined error message for response.
@Output() delete$: eventThis is file url delete.
@Output() onClickItem: eventEmit current url of file.
0.3.6

1 year ago

0.3.0

1 year ago

0.2.7

1 year ago

0.3.5

1 year ago

0.2.6

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.2.5

1 year ago

0.3.3

1 year ago

0.2.4

1 year ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago