In component :
singleEvent$: Observable<Event>;
On init, I get observable
this.singleEvent$ = this._eventService.events$
.map(function (events) {
let eventObject = events.find(item => item.id === eventid);
let eventClass: Event = new Event(eventObject);
return eventClass;
});
How can I take current value like event.name
?
To get data from an observable, you need to subscribe:
this.singleEvents$.subscribe(event => this.event = event);
In the template you can directly bind to observables using the async pipe:
{{singleEvents$ | async}}