Closed jziggas closed 6 years ago
Installing RxJS types via yarn add @types/rx --dev
resolved the error.
Adding import 'rxjs/add/operator/map';
to the import section also does the trick.
I had to restart Visual Code for this to work.
import 'rxjs/add/operator/map'; this does not work for me? i am getting error in map
//create a new Department
createDepartment(name:string, description:string): Promise
Even I am facing the same issue
Encapsulate map in pipe pipe(map(....))
@nagamallabhanu could you show us an example?? I have the same problem..
Hi @fatigasbuenaonda I think sth like this - https://medium.com/coding-snippets/rxjs-5-5-property-map-does-not-exist-on-type-observable-e825129c2068 could do the job.
THE FINAL ANSWER FOR THOSE WHO USES ANGULAR 6:
Add the below command in your *.service.ts file"
import { map } from "rxjs/operators";
**********************************************Example**Below**************************************
getPosts(){
this.http.get('http://jsonplaceholder.typicode.com/posts')
.pipe(map(res => res.json()));
}
}
I am using windows 10;
angular6 with typescript V 2.3.4.0
@smitpatelx thanks this is work for me...
Works fine. Thanks alot.
@smitpatelx thanks man
The angular new version does not support .map you have to install this through cmd npm install --save rxjs-compat via this you can enjoy with old technique . note: don't forget to import these lines. import { Observable, Subject } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; thank you
@smitpatelx thanks, worked for me
@maksof-kashif thanks, its worked for me
Thanks it's worked for me
@smitpatelx - thanks a ton! it worked!!
Hello, folks! Thanks to everyone for helping out with fixing the issues. Just FYI: I work on a significant refactoring of this workshop, incorporating all the latest Angular/NGSW/Workbox updates. Of course, it all will be open-sourced. ETA: mid-September.
try to import : import 'rxjs/Rx';
npm install --save rxjs-compat@6 SOLVED
@smitpatelx thanks works for me
Works fine... thanks alot.
@maksof-kashif thanks
npm install --save rxjs-compat@6
@Rename94 that worked for me! thanks
@maksof-kashif Perfect!
THE FINAL ANSWER FOR THOSE WHO USES ANGULAR 6:
Add the below command in your *.service.ts file"
import { map } from "rxjs/operators"; **********************************************Example**Below************************************** getPosts(){ this.http.get('http://jsonplaceholder.typicode.com/posts') .pipe(map(res => res.json())); } }
I am using windows 10;
angular6 with typescript V 2.3.4.0
Merci beaucoup, j'avais le meme probleme, maintenant ca vas
Encapsulate map in pipe pipe(map(....))
Working Fine. Thank you...
Thank
Le mer. 6 févr. 2019 à 08:48, devijonnalagadda notifications@github.com a écrit :
Encapsulate map in pipe pipe(map(....))
Working Fine. Thank you...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/webmaxru/pwa-workshop-angular/issues/2#issuecomment-460918332, or mute the thread https://github.com/notifications/unsubscribe-auth/Ahf8busNW-oUtC1izbT6npj0UvipxKi5ks5vKnqogaJpZM4OLnwp .
-- Freddy KADIATA
Restart vs code and verify
A further related topic: https://stackoverflow.com/questions/46005430/property-json-does-not-exist-on-type-object
The angular new version does not support .map you have to install this through cmd npm install --save rxjs-compat via this you can enjoy with old technique . note: don't forget to import these lines. import { Observable, Subject } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; thank you
thank you it works for me.
@maksof-kashif you are the best, thanks
thanks it worked for me
This below code solved my issue.
` import { map } from 'rxjs/operators';
return this.http.delete("https://.........................herokuapp.com/item/"+id) .pipe(map(res => res.json()));`
import { map } from 'rxjs/operators';
npm install --save rxjs-compat import { map } from 'rxjs/operators'; plus .pipe(map(...
first install the falowing: npm install --save rxjs-compat
and import: import { Observable, Subject } from 'rxjs';
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch';
npm install --save rxjs-compat@next worked for me.
The angular new version does not support .map you have to install this through cmd npm install --save rxjs-compat via this you can enjoy with old technique . note: don't forget to import these lines. import { Observable, Subject } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; thank you
Thank you its working well
thanks
thanks
import 'rxjs/add/operator/map'; if does not work run npm install --save rxjs-compat
thanks a lot
On Fri, Apr 10, 2020 at 12:22 AM Fadhlaoui Raed notifications@github.com wrote:
import 'rxjs/add/operator/map'; if does not work just restart the vscode
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/webmaxru/pwa-workshop-angular/issues/2#issuecomment-611695064, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA5QLUJQMJOELZSTLQ23NLRLYKNHANCNFSM4DROPQUQ .
Yo tenía este problema: Property 'map' does not exist on type 'Observable
La solución la encontré en: npm install --save rxjs-compat
y con: import 'rxjs/add/operator/map';
import {Observable} from 'rxjs/Rx'; This worked for me.
Followed the instructions in the
README.md
, got this error when runningng-serve
.