|
|
|
@ -34,11 +34,10 @@ export class SearchComponent implements OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.searchTerms
|
|
|
|
this.results = this.searchTerms
|
|
|
|
.debounceTime(300)
|
|
|
|
.debounceTime(300)
|
|
|
|
.distinctUntilChanged()
|
|
|
|
.distinctUntilChanged()
|
|
|
|
.switchMap(name => this.createAPIObservable(name))
|
|
|
|
.switchMap(name => this.createAPIObservable(name));
|
|
|
|
.subscribe(results=> this.results = results );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|