Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 28, 2021 14:23
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/8c112a425aecbad31fc6da8b6c3a761c to your computer and use it in GitHub Desktop.
Save bjoerntx/8c112a425aecbad31fc6da8b6c3a761c 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-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public _http: HttpClient;
public _baseUrl: string;
constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
this._http = http;
this._baseUrl = baseUrl;
}
async onClickLoadDocument(documentName: string) {
// get a document from the Web API endpoint 'LoadDocument'
this._http.get<any>(this._baseUrl + 'api/textcontrol/loaddocument?documentName=' + documentName).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