In my package.json file, I've "rxjs": "~6.3.3" and "rxjs-compat": "^6.5.2".With this I'm trying to use the map() method in a service of my project
whenever, I'm running ng serve, I'm getting this error -
Error in node_modules/rxjs-compat/operator/shareReplay.d.s(2,10):error TS2305
in rxjs library version +6, simple map method does not work. you should do some steps. first you should import map method as a operator from rxjs library.
in your ts file you should write:
then everywhere you wnat to use map method,before that you should use pipe method and inside that you should bring map method. for example imagine that you have a GET method to obtain the data from one endpoint. you should do like this:
i hope it works for you