Angular 6 RxJs Imports

0

Does anyone know why I get the following error?

  

ERROR Error: Uncaught (in promise): TypeError: this.searchField.valueChanges.switchMap is not a function   TypeError: this.searchField.valueChanges.switchMap is not a function

I already tried importing switchMap and map in all possible ways, of all possible versions.

this.results$ = this.searchField.valueChanges
                    // cada cambio (query) en el searchField, hara una consulta
                    .switchMap(query => this.http.get('${URL}?address=${query}'))
                    // convertimos la response en json
                    .map(response => response.json())
                    // devuelve los resultados finales
                    .map(response => response.results);
    
asked by MarianoV 22.09.2018 в 03:14
source

0 answers