How to use/import http module?

前端 未结 13 2337
鱼传尺愫
鱼传尺愫 2020-11-27 16:40

I\'ve been playing with Angular 2 Quickstart.

How can I use/import http module in Angular 2?

I\'ve looked at Angular 2 Todo\'s.js, but it doesn\'t use the ht

13条回答
  •  天命终不由人
    2020-11-27 17:34

    1. We are working on a separate data persistence layer, that will cover HTTP. This is not finished yet.
    2. Because of Zone in Angular 2 you can use any existing mechanism for fetching data. This includes XMLHttpRequest, fetch() and any other third party libraries.
    3. XHR in the compiler is meant to be private, and we can change the API at any time and as such should not be used.

提交回复
热议问题