Angular pokazywanie danych w czasie rzeczywistym

0

Mam rest w który dane zmienia ją się co 30 sekund. Chce zmiany pokazywać na bieŻąco (Boże, widzisz takie błędy i nie grzmisz).
Service

import {HttpClient} from "@angular/common/http";
import {Observable} from "rxjs";
import {Currencies} from "../model/currencies";

@Injectable({
  providedIn: 'root'
})
export class ExchangeRateService {

   baseUrl :string ="http://localhost:8180";
  constructor(private  http:HttpClient) { }
  getCurrencies() : Observable<Currencies> {
    return this.http.get<Currencies>( this.baseUrl);
  }
}

Component

import {Component, Input, OnInit} from '@angular/core';
import {ExchangeRateService} from "../services/exchange-rate.service";
import {Observable} from "rxjs";
import {Currencies} from "../model/currencies";

@Component({
  selector: 'app-exchange-rate',
  templateUrl: './exchange-rate.component.html',
  styleUrls: ['./exchange-rate.component.css']
})
export class ExchangeRateComponent implements OnInit {
  currencies$: Observable<Currencies>;
  constructor(private exchangeRateService:ExchangeRateService) { }

  ngOnInit() {

    this.currencies$ = this.exchangeRateService.getCurrencies();
  }

}

html

<div  class="col-md-7">{{currencies$.publicationDate |async}}</div>// wyświetla błąd 
<div *ngFor="let c of currencies$.items | async" class="col-md-7">// wyświetla błąd 
<ul class="list-group">
 <li class="list-group-item">Author: {{c.id}}</li>
 <li class="list-group-item">Comments: {{c.description}}</li>
</ul>

model

import {Currency} from "./currency";

export class Currencies {
  public publicationDate; string ;
  public items:Currency[];
}

export class Currency {

public name:string ;
public code:string ;
public unit:number;
public purchasePrice:number;
public sellPrice:number;
public averagePrice:number;
}

Nie wiem jak dostać do zmiennej currencies$.publicationDate >// wyświetla błąd
currencies$.items // wyświetla błąd
Jak dostać się do Observable currencies$.publicationDate w przykładach, które widziałem ad razu literowali i wyświetlali niestety ja mam trochę inna strukturę modelu

0

Podasz co to za błąd?
I czemu w model masz średnik zamiast dwukropka?

 public publicationDate; string ;
0

Poprawiłem ale dalej mam na czerwono validator nie widzi tego pola jeśli chce dostać się do pola currencies$.publicationDate. c

0
{{currencies$.publicationDate |async}}

zamień na

{{(currencies$ | async).publicationDate}} 

i to niżej tez w taki sam sposób

1 użytkowników online, w tym zalogowanych: 0, gości: 1