How do you import RxJs operators?

Looking to import rxjs operators, but I keep getting errors at runtime that Object doesn't support property or method named 'map'

From the Angular2 docs, it looks like this should work. I double checked my package.json file, and I have a dependency to version 5.0.0-beta.6

import 'rxjs/operator/map';

UPDATE
I was close. Looks like I need to import 'rxjs/add/operator/map'; but doesn’t fix the intellisense.

After running around in circles with this issue also, I found this implementation here in the Angular documentation and it has work well for me. I created a separate file rxjs-operators.ts and then import it. Now no more intellisense complaints. :sweat_smile:

https://angular.io/docs/ts/latest/guide/server-communication.html#!#enable-rxjs-operators

1 Like