Property 'fromEvent' does not exist on type 'typeof Observable'

rxjs 6升级所导致:

Observable.fromEvent(input, 'keyup')
    .debounceTime(300)
    .pluck('target', 'value')
    .switchMap((url) => Http.get(url))
    .subscribe(res => {
    });

改为

import { fromEvent, of } from 'rxjs';
import { debounceTime, pluck, switchMap} from 'rxjs/operators';

fromEvent(input, 'keyup')
            .pipe(
                debounceTime(300),
                pluck('target', 'value'),
                switchMap((url) => Http.get(url))
            )
            .subscribe(res => {
            });

 

你可能感兴趣的:(angular)