Map doesn't exist on Observable<Object> with angular 6.0.0 and rxjs 6.1.0

前端 未结 7 741
情歌与酒
情歌与酒 2020-12-29 07:46

Hi I\'m trying to follow a tutorial on angular but the tutorial was made in September. I believe the person used angular-cli 1.3.2. I\'m not sure which version of rxjs he wa

7条回答
  •  情深已故
    2020-12-29 08:04

    In rxjs@6 you can use from as standalone function:

    import { from } from 'rxjs';
    

    See also migration to rxjs6 guide

    https://github.com/ReactiveX/rxjs/blob/master/docs_app/content/guide/v6/migration.md#import-paths

    UPDATE

    You need to switch to pipe syntax, make sure you import all operators used from rxjs/operators. For example:

    import { map, filter, catchError, mergeMap } from 'rxjs/operators';
    

    DOCUMENTATION

提交回复
热议问题