docs(Http): add docs for Http lib

Fixes #2442
This commit is contained in:
Jeff Cross
2015-06-09 15:18:57 -07:00
parent e68e69e7e5
commit 5b5ffe75d0
18 changed files with 558 additions and 218 deletions

View File

@ -1,10 +1,41 @@
/**
* @module
* @public
* @description
* The http module provides services to perform http requests. To get started, see the {@link Http}
* class.
*/
import {bind, Binding} from 'angular2/di';
import {Http, HttpFactory} from './src/http/http';
import {XHRBackend} from 'angular2/src/http/backends/xhr_backend';
import {XHRBackend, XHRConnection} from 'angular2/src/http/backends/xhr_backend';
import {BrowserXHR} from 'angular2/src/http/backends/browser_xhr';
import {BaseRequestOptions} from 'angular2/src/http/base_request_options';
import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options';
export {Http};
export {MockConnection, MockBackend} from 'angular2/src/http/backends/mock_backend';
export {Request} from 'angular2/src/http/static_request';
export {Response} from 'angular2/src/http/static_response';
export {Http, XHRBackend, XHRConnection, BaseRequestOptions, RequestOptions, HttpFactory};
export {IHttp} from 'angular2/src/http/interfaces';
export {Headers} from 'angular2/src/http/headers';
/**
* Provides a basic set of injectables to use the {@link Http} service in any application.
*
* #Example
*
* ```
* import {httpInjectables, Http} from 'angular2/http';
* @Component({selector: 'http-app', appInjector: [httpInjectables]})
* @View({template: '{{data}}'})
* class MyApp {
* constructor(http:Http) {
* http.request('data.txt').subscribe(res => this.data = res.text());
* }
* }
* ```
*
*/
export var httpInjectables: List<any> = [
bind(BrowserXHR)
.toValue(BrowserXHR),