Now you can make ajax requests on node.
-
Install the package
$ npm install --save angular2-http-node_backend
-
Provide a custom
Http
instance which usesNodeBackend
import { NodeBackend } from 'angular2-http-node_backend'; bootstrap(App, [ HTTP_PROVIDERS, provide(NodeBackend, { useFactory: (respOpt) => new NodeBackend(respOpt), deps: [ResponseOptions]}), provide(Http, {useFactory: (backend, options) => { return new Http(backend, options); }, deps: [NodeBackend, RequestOptions]}) ])
-
Profit