I\'m trying to return an observable when I get a certain value in a subscriber, but I fail miserably.
This is the code:
canActivate(route: Activated
Couldn't we just use pipe
with map
from import { map } from 'rxjs/operators';
?
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class SearchHostService {
constructor(private http: HttpClient) { }
searchForHosts(searchString: string): Observable {
const res = >this.http.get('./assets/host-users.json');
const result = res.pipe(
map(val =>
val.filter(emp => emp.displayName.toLowerCase().startsWith(searchString))
));
return result;
}
}