如何在AngularJS 2.0的HTTP请求 [英] How to make HTTP requests in AngularJS 2.0

查看:198
本文介绍了如何在AngularJS 2.0的HTTP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道我可以在新的angularjs 2.0以及如何http请求挂钩这项服务到控制器。

I just want to know how i can make http requests in the new angularjs 2.0 and how to hook this service to a controller.

感谢您。

推荐答案

截至目前HTTP模块/组件仍处于开发阶段,尚未公布。在此期间有两个替代方案的使用方法:

As of now the http module/component is still under development and not yet released. In the interim there are two alternatives to use:

  • fetch (https://github.com/github/fetch)
  • axios (https://github.com/mzabriskie/axios)

您可以了解更多有关新的HTTP服务(S)S的位置:

You can learn more about the new http service(s)S here:

  • https://github.com/jeffbcross/http-design
  • https://docs.google.com/document/d/1DMacL7iwjSMPP0ytZfugpU4v0PWUK0BT6lhyaVEmlBQ/edit

这篇关于如何在AngularJS 2.0的HTTP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆