angular-cn/public/docs/js/latest/api/http/HTTP_BINDINGS-const.jade

25 lines
718 B
Plaintext

.l-main-section
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.37/modules/angular2/http.ts#L64-L74">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 {HTTP_BINDINGS, Http} from 'http/http';
@Component({selector: 'http-app', viewBindings: [HTTP_BINDINGS]})
@View({template: '{{data}}'})
class MyApp {
constructor(http:Http) {
http.request('data.txt').subscribe(res => this.data = res.text());
}
}
```