Angular 2: Property 'toPromise' does not exist on type 'Observable'

前端 未结 2 1862
北恋
北恋 2021-01-07 07:22

I\'m developing Angular 2 project and following Http Client Guide for implementing HTTP request But receiving following error when using RsJxmodule.

2条回答
  •  逝去的感伤
    2021-01-07 07:51

    I think this is a bug in Visual Studio (I'm guessing you're seeing this behavior in VS2015?) I have exactly this issue when I try working with an Angular2 app in VS2015.

    As a work around you might try working with your project using Visual Studio Code instead. I opened your referenced repository using VS Code and verified it had intellisense for rxjs extensions (like toPromise) as expected. However, as you sate, in VS2015 rxjs extensions are not being found and show as errors.

提交回复
热议问题