angular-cn/public/docs/js/latest/api/http/httpInjectables-var.jade
2015-07-28 13:41:07 -07:00

26 lines
782 B
Plaintext

.l-main-section
h2 httpInjectables <span class="type">variable</span>
p.location-badge.
exported from <a href='../http'>angular2/http</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/http.ts#L64-L71">angular2/http.ts (line 64)</a>
:markdown
Provides a basic set of injectables to use the <a href='Http-class.html'><code>Http</code></a> service in any application.
#Example
```
import {httpInjectables, Http} from 'angular2/http';
@Component({selector: 'http-app', viewInjector: [httpInjectables]})
@View({template: '{{data}}'})
class MyApp {
constructor(http:Http) {
http.request('data.txt').subscribe(res => this.data = res.text());
}
}
```