refactor(Http): remove HttpFactory
BREAKING CHANGE: HttpFactory is no longer available. This factory provided a function alternative to the `request` method of the Http class, but added no real value. The additional factory required an additional IHttp interface, an odd way to inject while preserving type information (`@Inject(HttpFactory) http:IHttp`), and required additional documentation in the http module. Closes #2564
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* class.
|
||||
*/
|
||||
import {bind, Binding} from 'angular2/di';
|
||||
import {Http, HttpFactory} from './src/http/http';
|
||||
import {Http} from './src/http/http';
|
||||
import {XHRBackend, XHRConnection} from 'angular2/src/http/backends/xhr_backend';
|
||||
import {BrowserXHR} from 'angular2/src/http/backends/browser_xhr';
|
||||
import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options';
|
||||
@ -17,7 +17,6 @@ export {Request} from 'angular2/src/http/static_request';
|
||||
export {Response} from 'angular2/src/http/static_response';
|
||||
|
||||
export {
|
||||
IHttp,
|
||||
IRequestOptions,
|
||||
IResponse,
|
||||
Connection,
|
||||
@ -26,7 +25,7 @@ export {
|
||||
|
||||
export {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options';
|
||||
export {XHRBackend, XHRConnection} from 'angular2/src/http/backends/xhr_backend';
|
||||
export {Http, HttpFactory} from './src/http/http';
|
||||
export {Http} from './src/http/http';
|
||||
|
||||
export {Headers} from 'angular2/src/http/headers';
|
||||
|
||||
@ -50,12 +49,5 @@ export {URLSearchParams} from 'angular2/src/http/url_search_params';
|
||||
* ```
|
||||
*
|
||||
*/
|
||||
export var httpInjectables: List<any> = [
|
||||
bind(ConnectionBackend)
|
||||
.toClass(XHRBackend),
|
||||
BrowserXHR,
|
||||
XHRBackend,
|
||||
BaseRequestOptions,
|
||||
bind(HttpFactory).toFactory(HttpFactory, [XHRBackend, BaseRequestOptions]),
|
||||
Http
|
||||
];
|
||||
export var httpInjectables: List<any> =
|
||||
[bind(ConnectionBackend).toClass(XHRBackend), BrowserXHR, XHRBackend, BaseRequestOptions, Http];
|
||||
|
Reference in New Issue
Block a user