Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active June 8, 2020 14:08
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/11eccaea71f09b940b614e6c38aa40df to your computer and use it in GitHub Desktop.
Save bjoerntx/11eccaea71f09b940b614e6c38aa40df 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;
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