How to correctly import operators from the `rxjs` package

后端 未结 2 1359
旧巷少年郎
旧巷少年郎 2020-12-01 15:05

I am confused how to import those operators. Some I can import with import \'rxjs/add/operator/do\'; and some I can not. For ex, this does not work: impo

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-01 15:50

    Lower version of rxjs has got folder

    node_modules\rxjs\operator

    Higher version of rxjs has got folder

    node_modules\rxjs\operators

    Please make sure the typescript file location is exists for map and other operators exists within.

    If problem still persist please delete rxjs folder from node_modules and run the command

    npm  install --save 
    

    usually this causes due to lowering the package version from higher version of rxjs.

提交回复
热议问题