Skip to content

Instantly share code, notes, and snippets.

@bobbyg603
Last active May 11, 2022 20:31
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/42766ec7ae9b6b9d8cd63d3e14c17388 to your computer and use it in GitHub Desktop.
Save bobbyg603/42766ec7ae9b6b9d8cd63d3e14c17388 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 { 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');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment