import { Component } from '@angular/core'; import { BaseRequestOptions, Http } from '@angular/http'; @Component({ selector: 'app-footer', templateUrl: 'src/app/footer.component.html' }) export class FooterComponent { securisVersion : string = '0.0.0'; constructor( private http: Http, ) { } ngOnInit(): void { //TODO Move to service this.http.get("version", /* workaround to avoid OPTIONS method request*/ new BaseRequestOptions()) .map((res) => res.json().version) .subscribe( version => this.securisVersion = version, err => this.securisVersion = '0.0.0' ); } }