diff --git a/frontend/src/app/component/landing/landing.component.ts b/frontend/src/app/component/landing/landing.component.ts index d7c91f2..9261559 100644 --- a/frontend/src/app/component/landing/landing.component.ts +++ b/frontend/src/app/component/landing/landing.component.ts @@ -1,9 +1,8 @@ -import {Component, OnInit, ViewChild} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {RestService} from '../../services/rest.service'; import {WebsocketService} from '../../services/websocket.service'; import {NGXLogger} from 'ngx-logger'; import {Subscription} from 'rxjs'; -import {TestSubCompComponent} from "../testsubcomp/test-sub-comp.component"; @Component({ selector: 'app-landing', @@ -42,7 +41,7 @@ export class LandingComponent implements OnInit { private observableCall(): void { - const subscription = this.restService.testCall().subscribe( + const subscription = this.restService.testCall(1).subscribe( // subscribe with lambda function response => { this.logger.debug('Execute obs test call', response); @@ -56,7 +55,7 @@ export class LandingComponent implements OnInit { } private promiseCall(): void { - this.restService.testCall().toPromise() + this.restService.testCall(2).toPromise() // lambda for success .then(response => { this.logger.debug('Execute obs test call', response); diff --git a/frontend/src/app/services/rest.service.ts b/frontend/src/app/services/rest.service.ts index eabf882..191381d 100644 --- a/frontend/src/app/services/rest.service.ts +++ b/frontend/src/app/services/rest.service.ts @@ -1,4 +1,4 @@ -import {HttpClient, HttpResponse} from '@angular/common/http'; +import {HttpClient} from '@angular/common/http'; import {Injectable} from '@angular/core'; import {NGXLogger} from 'ngx-logger'; import {environment} from '../../environments/environment'; @@ -14,9 +14,9 @@ export class RestService { ) { } - testCall(): Observable { + testCall(i: number): Observable { const url = this.currentLocation + 'test/'; - this.logger.debug('Performing test rest call on', url); + this.logger.debug('Performing ' + i + '. test rest call on', url); return this.http.get(url); } }