.
:
<div class="team" (click)="addToFavorite()">
.component.ts:
public addToFavorite() {
this
.match // should retain last value (e.g. use BehaviorSubject)
.first() // completes after passing one value only
.subscribe(
(matchValue) => {
// your logic here
});
}
Note: we subscribe (and immediately unsubscribe), similarly the asyncchannel subscribes to Observable.
source
share