Last active
June 8, 2020 14:08
-
-
Save bjoerntx/11eccaea71f09b940b614e6c38aa40df 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; | |
declare const loadInitialDocument: any; | |
@Component({ | |
selector: 'app-home', | |
templateUrl: './home.component.html', | |
}) | |
export class HomeComponent { | |
public _http: HttpClient; | |
public _baseUrl: string; | |
constructor(http: HttpClient, @Inject('BASE_URL') baseUrl: string) { | |
this._http = http; | |
this._baseUrl = baseUrl; | |
// get a document from the Web API endpoint 'LoadDocument' | |
this._http.get<any>(this._baseUrl + 'api/viewer/loaddocument').subscribe(result => { | |
loadInitialDocument(result); | |
}, error => console.error(error)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment