|
14
2
|
I've been playing with Angular 2 Quickstart. How can I use/import http module in Angular 2? I've added |
||||
|
|
2
|
I believe that now (alpha.35 and 36) is needed to be:
Remember to add (since now is a separate file) the reference in your html: https://code.angularjs.org/2.0.0-alpha.36/http.dev.js |
||||||||||||
|
|
20
|
|
||||||||
|
|
10
|
Last update: Jul 27, 2015
A simple example of how to use the Http module with Observable: app.ts:
questionApi.ts:
|
||||
|
|
2
|
Its already in angular2, so you dont need to put anything in package.json You just have to import and inject it like this. (this is a Stuff service with a methodThatUsesHttp() that just logs the response)
|
||||||||
|
|
0
|
In version 37 you need to do this:
And run this tsd command:
|
|||
|
-1
|
A simple example using the http module:
You can have the complete working app here: https://github.com/kaalpurush/ng2-http |
||||||||
|
|
Name
Email
|
By posting your answer, you agree to the privacy policy and terms of service.
| Technology | Life / Arts | Culture / Recreation | Science | Other | ||
|---|---|---|---|---|---|---|