This property fromEvent does not exist on type 'typeof Observable' Angular 6

后端 未结 2 1257
我在风中等你
我在风中等你 2021-01-03 20:21

I am having a problem trying to create to turn the keyup events into an observable stream.

I am following the Ng-book version 6. I am stuck in an ex

2条回答
  •  失恋的感觉
    2021-01-03 20:48

    In RxJS 5, you were writing

    import { Observable } from 'rxjs/Observable';
    import 'rxjs/add/observable/of';
    import 'rxjs/add/operator/map';
    

    The imports changed for RxJS 6

    import { Observable, of, Subject, Subscription } from 'rxjs';
    import { map, filter, debounceTime, distinctUntilChanged } from 'rxjs/operators';
    

    For more information, have a look at the RxJS migration guide.

提交回复
热议问题