Last active
May 11, 2022 20:37
-
-
Save bobbyg603/cae0e4a3d0e8a050f7cfd962aab09e65 to your computer and use it in GitHub Desktop.
FIle Uploads with Angular and Express
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpClient } from '@angular/common/http'; | |
import { Component, OnInit } from '@angular/core'; | |
import { NgxFileDropEntry } from '@bugsplat/ngx-file-drop'; | |
import { Observable } from 'rxjs'; | |
import { FilesTableEntry } from './files/files-table-entry'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.scss'] | |
}) | |
export class AppComponent { | |
files$?: Observable<FilesTableEntry[]>; | |
constructor(private httpClient: HttpClient) { | |
this.files$ = this.httpClient.get<FilesTableEntry[]>('http://localhost:8080/files'); | |
} | |
onFilesDropped(files: NgxFileDropEntry[]): void { | |
console.log(files); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment