update
This commit is contained in:
parent
30aa3ca8f9
commit
89a047023a
@ -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);
|
||||
|
||||
@ -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<string> {
|
||||
testCall(i: number): Observable<string> {
|
||||
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<string>(url);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user