Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

File Upload with Angular Material

<mat-form-field class="columns">
    <mat-label *ngIf="selectedFiles; else newFile">{{selectedFiles.item(0).name}}</mat-label>
    <ng-template #newFile>
        <mat-label>Choose file</mat-label>
    </ng-template>
    <input matInput disabled>
    <button mat-icon-button matSuffix (click)="fileInput.click()">
        <mat-icon>attach_file</mat-icon>
    </button>
    <input hidden (change)="selectFile($event)" #fileInput type="file" id="file">
</mat-form-field>


::::::::: AND TS ::::::
selectFile(event) {
    this.selectedFiles = event.target.files;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery textarea autosize 
Javascript :: vue dynamic component props 
Javascript :: fetch post 
Javascript :: relaod the page in express 
Javascript :: discord bot playing game 
Javascript :: how to remove an element from a parent element javascript 
Javascript :: React does not recognize the `activeClassName` prop on a DOM element 
Javascript :: require is not defined on html script with electron 
Javascript :: how to get the max value of two variables in math 
Javascript :: angular dynamic class 
Javascript :: javascript onmouseover change image 
Javascript :: javascript format rupiah 
Javascript :: add item to list javascript 
Javascript :: ecmascript compose 
Javascript :: jquery remove child 1 elemtn 
Javascript :: js clone deep 
Javascript :: flip a coin javascript 
Javascript :: toggle button by javascript 
Javascript :: get value json python 
Javascript :: desable no unused vars in vue.js 
Javascript :: multiline comment in react 
Javascript :: phone patter regex 
Javascript :: “javascript remove last element from array 
Javascript :: search inside a string javascript 
Javascript :: how to make view dotted line in jsx 
Javascript :: js convert special characters to html entities 
Javascript :: javascript add listeners to class 
Javascript :: dom element get attribute 
Javascript :: document print from html javascript 
Javascript :: chrome input disable autofill 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =