Last active
May 11, 2022 20:31
-
-
Save bobbyg603/42766ec7ae9b6b9d8cd63d3e14c17388 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 { 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