@ -5,7 +5,7 @@
<section *ngIf="results">
<h2>Search Results</h2>
<ul>
<li *ngFor="let character of results">
<li *ngFor="let character of results | async">
<h3>{{character.name}}</h3>
<dl>
<dt>Birth Year</dt>
@ -34,11 +34,10 @@ export class SearchComponent implements OnInit {
}
ngOnInit() {
this.searchTerms
this.results = this.searchTerms
.debounceTime(300)
.distinctUntilChanged()
.switchMap(name => this.createAPIObservable(name))
.subscribe(results=> this.results = results );
.switchMap(name => this.createAPIObservable(name));