Skip to content

Instantly share code, notes, and snippets.

@bobbyg603
Last active May 11, 2022 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbyg603/cae0e4a3d0e8a050f7cfd962aab09e65 to your computer and use it in GitHub Desktop.
Save bobbyg603/cae0e4a3d0e8a050f7cfd962aab09e65 to your computer and use it in GitHub Desktop.
FIle Uploads with Angular and Express
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