Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 21, 2024 13:26
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 bjoerntx/47d648540a3223e5a97c0eabc60a1b62 to your computer and use it in GitHub Desktop.
Save bjoerntx/47d648540a3223e5a97c0eabc60a1b62 to your computer and use it in GitHub Desktop.
export class AppComponent implements OnInit {
// public array of DocumentData
public documentList: DocumentData[] = [];
public selectedDocument: DocumentData | undefined;
constructor(private http: HttpClient) {}
ngOnInit() {
this.getFilenames();
}
getFilenames() {
this.http.get<DocumentData[]>('/document/list').subscribe(
(result) => {
this.documentList = result;
},
(error) => {
console.error(error);
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment