add The searchTerms RxJS subject
This commit is contained in:
parent
ef2309f0f1
commit
f6d361eb84
|
@ -37,4 +37,12 @@ export class HeroSearchComponent implements OnInit {
|
||||||
switchMap((term: string) => this.heroService.searchHeroes(term)),
|
switchMap((term: string) => this.heroService.searchHeroes(term)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private searchTerms = new Subject<string>();
|
||||||
|
|
||||||
|
// Push a search term into the observable stream.
|
||||||
|
search(term: string): void {
|
||||||
|
this.searchTerms.next(term);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue