Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created June 8, 2020 14:14
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/320704877a68260d7e0c5ebe048436d1 to your computer and use it in GitHub Desktop.
Save bjoerntx/320704877a68260d7e0c5ebe048436d1 to your computer and use it in GitHub Desktop.
import { Component, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
declare const loadDocument: any;
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
})
export class HomeComponent {
public _http: HttpClient;
public _baseUrl: string;
async onClickLoadDocument() {
// get a document from the Web API endpoint 'LoadDocument'
this._http.get<any>(this._baseUrl + 'api/viewer/loaddocument').subscribe(result => {
loadDocument(result);
}, error => console.error(error));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment