Created
July 28, 2021 14:23
-
-
Save bjoerntx/8c112a425aecbad31fc6da8b6c3a761c to your computer and use it in GitHub Desktop.
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 { 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