0.3.6 • Published 1 year ago
mat-upload v0.3.6
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
Name | Description |
---|---|
Latest update | combine @Input() options: MatUploadOptions |
label: string | The label for upload card. |
description: string | Description for drag and drop. |
serverUrl: string or undefined | Environment for case image Url return Test/sample.png this will returun serverUrl + Test/sample.png . |
apiUrl: string | Environment api server for upload file. |
typeUpload: string | single or multiple or dragNdrop |
accessToken: string or undefined | Your bearer token. |
location: string or undefined | Your location upload. |
accept: string | Read more https://www.w3schools.com/tags/att_input_accept.asp . Example: image/png,image/jpg |
valueKey: string | This's key of response object. Example: {error: 0, message: 'success'} =>keyUrl = "message" => formControl.value = ['success'] |
messageUploadError: string | This is error upload message. |
messageExtensionError: string | This is error extension message. |
snackBarClass: string | Defined 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$: event | This is file url delete. |
@Output() onClickItem: event | Emit 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